Preprocessing of OSM Building Data (HDB)

Preprocesses OSM Building Data with HDB Property Information
Preprocessing
Urban
HDB
Building
R
Author

Teo Ren Jie

Published

August 4, 2024

Modified

August 17, 2024

1 Overview

1.1 Aims

  • To evaluate which data source is most complete and suitable

    • OSM

    • data.gov.sg

  • To prepare the data sources for machine learning

    • Combination of data sources, fields and manual intervention

2 Getting Started

2.1 Setting Up

Packages required to be loaded for

pacman::p_load(dplyr, readr, sf, tidyverse, tmap, sfdep, ggplot2, plotly, spdep, rjson, osmextract, geojsonR, rvest, httr, jsonlite)

2.2 Data Sources

Dataset Name Source Methodology
HDB Existing Buildings Data.gov.sg Download
HDB Property Information (4 Aug 2024) Data.gov.sg Download
URA Master Plan 2019 Land Use (3 Jul 2023) Data.gov.sg Download
Humanitarian OSM Team Buildings Dataset (1 July 2024) HOTOSM Download

3 Key Functions

3.1 Onemap

get_postal <- function(addr_lst){
  
  # Create a data frame to store all retrieved coordinates
  new_postal <- data.frame()
  i = 0
  for (addr in addr_lst){
    i = i + 1
    
    if (i %% 100 == 0){
     print(c(addr, as.character(i)))
    }

    reply <- GET('https://www.onemap.gov.sg/api/common/elastic/search?',
           query = list(searchVal = addr,
                        returnGeom = 'N',
                        getAddrDetails = 'Y'))
    
    output <- fromJSON(rawToChar(reply$content))
    found <- output$found
    res <- output$results
    
    # Create a new data frame for each address
    new_row <- data.frame()
    
    # If single result, append 
    if (found >= 1){
      res_1 <- head(res, n = 1)
      postal <- res_1$POSTAL
      new_row <- data.frame(address = addr, postal = postal)
    }

    else {
      new_row <- data.frame(address = addr, postal = NA)
    }
    
    # Add the row
    new_postal <- rbind(new_postal, new_row)
    remove(new_row)
  }
  return(new_postal)
}
token = ""
get_postal_rev_geocode <- function(addr_lst){
  
  # Create a data frame to store all retrieved coordinates
  new_postal <- data.frame()
  for (i in 1:nrow(addr_lst)){

    if (i == 100){
          print(c(addr_lst[i,"X"][[1]], addr_lst[i,"Y"][[1]], as.character(i)))
    }
    query1 <- paste(addr_lst[i,"X"][[1]], addr_lst[i,"Y"][[1]], sep = ",")
    reply <- GET('https://www.onemap.gov.sg/api/public/revgeocodexy?',
            query = list(location = query1,
                        buffer = '50',
                        addressType = 'HDB'),
            add_headers("Content-Type"="application/json",
            Accept="application/+json",
            "Authorization"= paste("Bearer", token)))

    
    output <- fromJSON(rawToChar(reply$content))
    res <- output$GeocodeInfo
    found <- length(res)

    # Create a new data frame for each address
    new_row <- data.frame()
    
    # If single result, append 
    if (found >= 1){
      res_1 <- head(res, n = 1)
      if ((res_1$POSTALCODE) == "NIL"){
        postal <- NA
      }
      else{
        postal <- res_1$POSTALCODE
      }
      new_row <- data.frame(X = addr_lst[i,"X"][[1]], Y = addr_lst[i, "Y"][[1]], postal = postal)
    }

    else {
      new_row <- data.frame(X = addr_lst[i,"X"][[1]], Y = addr_lst[i, "Y"][[1]], postal = NA)
    }
    
    # Add the row
    new_postal <- rbind(new_postal, new_row)
  }
  return(new_postal)
}

4 Data Preparation

4.1 Loading Data

Loading HDB Property Information (4 Aug 2024)

RAW_HDB_PROPERTY <- read.csv("data/fyp_preprocessing/HDBPropertyInformation.csv")

Loading HDB Existing Buildings KML

https://stackoverflow.com/questions/50775357/how-to-read-in-kml-file-properly-in-r-or-separate-out-lumped-variables-into-col

raw_hdb_bldgs = st_read("data/fyp_preprocessing/HDBExistingBuilding.geojson")
Reading layer `HDBExistingBuilding' from data source 
  `C:\Users\renji\OneDrive - Singapore Management University\0_git-projects\urbancoalesce\explore\data\fyp_preprocessing\HDBExistingBuilding.geojson' 
  using driver `GeoJSON'
Simple feature collection with 12847 features and 2 fields
Geometry type: MULTIPOLYGON
Dimension:     XY, XYZ
Bounding box:  xmin: 103.6848 ymin: 1.270005 xmax: 103.989 ymax: 1.457245
z_range:       zmin: 0 zmax: 0
Geodetic CRS:  WGS 84
attributes <- lapply(X = 1:nrow(raw_hdb_bldgs), 
                     FUN = function(x) {

                       raw_hdb_bldgs %>% 
                         slice(x) %>%
                         pull(Description) %>%
                         read_html() %>%
                         html_node("table") %>%
                         html_table(header = TRUE, trim = TRUE, dec = ".", fill = TRUE) %>%
                         as_tibble(.name_repair = ~ make.names(c("Attribute", "Value"))) %>% 
                         pivot_wider(names_from = Attribute, values_from = Value)

                     })

hdb_bldgs <- 
  raw_hdb_bldgs %>%
  bind_cols(bind_rows(attributes)) %>%
  select(-Description)
hdb_bldgs <- st_zm(hdb_bldgs)
hdb_bldgs <- st_transform(hdb_bldgs, crs = 3414)

Loading Humanitarian OSM Buildings Dataset (1 July 2024)

osm_bldgs <- st_read("data/fyp_preprocessing/QUICKOSM_BLDGS_20240818_QGIS/osmbldgs_20240818.gpkg")
Reading layer `building_singapore' from data source 
  `C:\Users\renji\OneDrive - Singapore Management University\0_git-projects\urbancoalesce\explore\data\fyp_preprocessing\QUICKOSM_BLDGS_20240818_QGIS\osmbldgs_20240818.gpkg' 
  using driver `GPKG'
Simple feature collection with 121717 features and 477 fields
Geometry type: MULTIPOLYGON
Dimension:     XY
Bounding box:  xmin: 103.6059 ymin: 1.159946 xmax: 104.4063 ymax: 1.470583
Geodetic CRS:  WGS 84
osm_bldgs <- osm_bldgs %>%
  st_transform(crs = 3414)

TO-DO: EXTRACT HOTOSM DATA BASED ON MP19 LAND USE POLYGON = RESIDENTIAL (CAN SELECT HDB ONLY?)

tmap_options(check.and.fix = TRUE)
tmap_mode("plot")
tm_shape(osm_bldgs) +
  tm_fill(col = "building")

unique(osm_bldgs[['building']])
 [1] "yes"                         "garage"                     
 [3] "commercial"                  "school"                     
 [5] "industrial"                  "warehouse"                  
 [7] "residential"                 "retail"                     
 [9] "hotel"                       "church"                     
[11] "college"                     "hospital"                   
[13] "office"                      "civic"                      
[15] "public"                      "roof"                       
[17] "apartments"                  "education"                  
[19] "parking"                     "kindergarten"               
[21] "university"                  "dormitory"                  
[23] "stable"                      "house"                      
[25] "detached"                    "yes;industrial"             
[27] "construction"                "government"                 
[29] "temple"                      "bridge"                     
[31] "public;roof"                 "commercial;yes"             
[33] "train_station"               "transportation"             
[35] "service"                     "religious"                  
[37] NA                            "greenhouse"                 
[39] "hut"                         "mosque"                     
[41] "hangar"                      "sports_centre"              
[43] "grandstand"                  "waste_transfer_station"     
[45] "manufacture"                 "boathouse"                  
[47] "clinic"                      "terrace"                    
[49] "semidetached_house"          "chapel"                     
[51] "toilets"                     "ruins"                      
[53] "storage_tank"                "fire_station"               
[55] "synagogue"                   "swimming_pool_changing_room"
[57] "stadium"                     "mix_used"                   
[59] "shop"                        "guardhouse"                 
[61] "shed"                        "gazebo"                     
[63] "shrine"                      "CET_Campus_East"            
[65] "wayside_shrine"              "EiS_Residences"             
[67] "medical"                     "IMM"                        
[69] "farm_auxiliary"              "bungalow"                   
[71] "sports_hall"                 "hall"                       
[73] "carport"                     "monastery"                  
[75] "utility"                     "multi-purpose_stage"        
[77] "no"                          "security"                   
[79] "pavilion"                    "gateway"                    
[81] "seasonal"                    "pagoda"                     
[83] "switchroom"                  "garages"                    
[85] "yes;retail"                  "Security_Post"              
[87] "supermarket"                 "jtc_nanospace"              
[89] "gatehouse"                   "multi-purpose_hall"         
[91] "tent"                        "shelter"                    
[93] "tourism"                     "2"                          
[95] "kiosk"                       "bunker"                     
[97] "healthcare"                 

Key focus

  • residential

  • mix_used

  • yes

  • 2?

  • apartments

  • house

temp <- osm_bldgs %>% filter(building == "yes")

tmap_options(check.and.fix = TRUE)
tmap_mode("view")
tm_shape(temp) +
  tm_fill(col = "building")

Drop mix_used

temp <- osm_bldgs %>% filter(building == "mix_used")

tmap_options(check.and.fix = TRUE)
tmap_mode("view")
tm_shape(temp) +
  tm_fill(col = "building")
temp <- osm_bldgs %>% filter(building == "yes")

tmap_options(check.and.fix = TRUE)
tmap_mode("view")
tm_shape(temp) +
  tm_fill(col = "building")

Drop 2 - facility in boon lay

temp <- osm_bldgs %>% filter(building == "2")

tmap_options(check.and.fix = TRUE)
tmap_mode("view")
tm_shape(temp) +
  tm_fill(col = "building")

Keep - how to manage the HDB and condo and split them out?

temp <- osm_bldgs %>% filter(building == "apartments")

tmap_options(check.and.fix = TRUE)
tmap_mode("view")
tm_shape(temp) +
  tm_fill(col = "building")
temp <- osm_bldgs %>% filter(building == "house")

tmap_options(check.and.fix = TRUE)
tmap_mode("view")
tm_shape(temp) +
  tm_fill(col = "building")

EDA Summary

Retain following fields:

  • residential - some overlap with condo

  • yes - overlap with many other non residential

  • apartments - overlap with condo

proc_osm_bldgs <- osm_bldgs %>% filter(building %in% c("residential", "yes", "apartments"))
proc_osm_bldgs <- proc_osm_bldgs %>% filter(is.na(addr.street) == FALSE)
proc_osm_bldgs <- proc_osm_bldgs %>%
  mutate(proc_osm_bldgs, address = ifelse(is.na(addr.housenumber) == FALSE, paste(addr.housenumber, addr.street),addr.street))

Moving forward: combine with HDB data, check and drop remainder with no match with HDB dataset

addr_lst <- sort(unique(proc_osm_bldgs$address))
postal <- get_postal(addr_lst)

write_rds(postal, "data/fyp_preprocessing/osm_bldgs_postal.rds")
OSM_BLDGS_POSTAL <- read_rds("data/fyp_preprocessing/osm_bldgs_postal.rds")
temp_osm <- left_join(proc_osm_bldgs, OSM_BLDGS_POSTAL, by=c("address" = "address"))
temp_view <- temp_osm %>% filter(postal == "NIL")
unique(temp_view$address)
  [1] "Outram Road"                        "Seah Street"                       
  [3] "Kim Seng Road"                      "Jalan Haji Alias"                  
  [5] "Coronation Road West"               "Kaki Bukit Avenue 1"               
  [7] "Sin Ming Drive"                     "Tampines North Drive 2"            
  [9] "Tampines Road"                      "710A Ang Mo Kio Central 1"         
 [11] "714 Ang Mo Kio Central 1"           "Changi Village Road"               
 [13] "419 Bedok North Avenue 1"           "420 Bedok North Avenue 1"          
 [15] "Simei Street 6"                     "Heng Mui Keng Terrace"             
 [17] "Jalan Pekan Ubin"                   "Jalan Batu Ubin"                   
 [19] "Woodlands Square"                   "Simei Street 4"                    
 [21] "Ang Mo Kio Industrial Park 2A"      "980 Buangkok Green"                
 [23] "Riverside Road"                     "Joo Koon Circle"                   
 [25] "10 Tuas Avenue 10"                  "15 Tuas Street"                    
 [27] "13 Tuas Avenue 13"                  "Tuas Avenue 11"                    
 [29] "11 Tuas Avenue 11"                  "Gul Street 2"                      
 [31] "Yuk Tong Avenue"                    "Defu Lane 4"                       
 [33] "Defu Lane 3"                        "Joo Koon Way"                      
 [35] "Joo Koon Road"                      "Pandan Road"                       
 [37] "Bukit Batok West Avenue 5"          "Kallang Way"                       
 [39] "Fusionopolis Walk"                  "Loyang Avenue"                     
 [41] "Senoko Drive"                       "Telok Ayer Street"                 
 [43] "Farrer Road"                        "Purvis Street"                     
 [45] "2 Seragoon North Avenue 2"          "Coral Island"                      
 [47] "Ocean Drive"                        "Sandy Island"                      
 [49] "163 Bukit Batok West Avenue 8"      "162 Bukit Batok West Avenue 8"     
 [51] "155 Bukit Batok West Avenue 8"      "Bukit Batok East Avenue 6"         
 [53] "12 Artillery Avenue"                "Bukit Batok Street 31"             
 [55] "Margaret Drive"                     "91 Hougang Avenue 3"               
 [57] "85 Hougang Avenue 3"                "Defu Lane 1"                       
 [59] "Gambas Avenue"                      "Senoko Crescent"                   
 [61] "Maxwell Road"                       "Macalister Road"                   
 [63] "114 Bukit Purmei Avenue"            "Central Expressway"                
 [65] "113 Bukit Purmei Avenue"            "110 Bukit Purmei Avenue"           
 [67] "115 Bukit Purmei Avenue"            "112 Bukit Purmei Avenue"           
 [69] "111 Bukit Purmei Avenue"            "Delta Road"                        
 [71] "Peng Nguan Street"                  "103 Henderson Road"                
 [73] "44A Beo Crescent"                   "Ganges Avenue"                     
 [75] "Clarence Lane"                      "Penang Road"                       
 [77] "Moulmein Road"                      "Bencoolen Street"                  
 [79] "215 Airport Road"                   "Queensway"                         
 [81] "201 Commonwealth Avenue West"       "Yishun Ave 6"                      
 [83] "Cavenagh Road"                      "Defu Avenue 1"                     
 [85] "50 Clive Road"                      "Hoot Kiam Road"                    
 [87] "Paterson Road"                      "Wilkie Road"                       
 [89] "Joo Chiat Road"                     "Jalan Sultan"                      
 [91] "18 Baboo Lane"                      "Kelantan Road"                     
 [93] "Mount Faber Road"                   "Fernvale Road"                     
 [95] "Suffolk Road"                       "33 Chai Chee Road"                 
 [97] "34 Chai Chee Road"                  "35 Chai Chee Road"                 
 [99] "36 Chai Chee Road"                  "37 Chai Chee Road"                 
[101] "40 Chai Chee Road"                  "305D Punggol Road"                 
[103] "Chapel Road"                        "Draycott Drive"                    
[105] "215 Choa Chu Kang Central"          "216 Choa Chu Kang Central"         
[107] "Choa Chu Kang North 5"              "Ubi Road 3"                        
[109] "Race Course Lane"                   "Jansen Road"                       
[111] "Kovan Road"                         "Highland Road"                     
[113] "Tuas View Crescent"                 "Cove Drive"                        
[115] "Grange Road"                        "Emerald Hill Road"                 
[117] "Mandalay Road"                      "Bedok Reservoir Road"              
[119] "Hougang Street 11"                  "Joo Chiat Place"                   
[121] "Braddell Road"                      "Mackerrow Road"                    
[123] "3188 Geylang Bahru"                 "192C Punggol Road"                 
[125] "Oxford Road"                        "Pandan Gardens"                    
[127] "Changi Road"                        "Everitt Road"                      
[129] "Sembawang Road"                     "Bedok Road"                        
[131] "Jalan Chempaka Kuning"              "Koon Seng Road"                    
[133] "Bukit Timah Road"                   "Changi South Avenue 1"             
[135] "Siglap Road"                        "Ceylon Road"                       
[137] "Turnhouse Road"                     "Netheravon Road"                   
[139] "Lorong Marzuki"                     "Alexandra Road"                    
[141] "85 Bedok North Avenue 4"            "Toh Tuck Link"                     
[143] "Saint Martin's Drive"               "Chander Road"                      
[145] "13 Jalan Sentosa"                   "32 Chai Chee Road"                 
[147] "73N Jalan Senang"                   "91L Jalan Senang"                  
[149] "Pioneer Walk"                       "Pioneer Turn"                      
[151] "Guillemard Lane"                    "Aljunied Road"                     
[153] "Lorong 24 Geylang"                  "28 Lorong 28 Geylang"              
[155] "Lorong 28 Geylang"                  "Lorong 30 Geylang"                 
[157] "34 Lorong 34 Geylang"               "Lorong 34 Geylang"                 
[159] "Serangoon Road"                     "89 Bedok North Avenue 4"           
[161] "87 Bedok North Avenue 4"            "88 Bedok North Avenue 4"           
[163] "Kampong Bahru Road"                 "440C Clementi Close"               
[165] "293D Bukit Batok East Avenue 6"     "460A Bukit Batok West Avenue 8"    
[167] "460B Bukit Batok West Avenue 8"     "463B Bukit Batok West Avenue 8"    
[169] "Boscombe Road"                      "Parkstone Road"                    
[171] "224-J Jalan Endut Senin"            "Jalan Endut Senin"                 
[173] "84 Bedok North Avenue 4"            "86 Bedok North Avenue 4"           
[175] "90 Bedok North Avenue 4"            "91 Bedok North Avenue 4"           
[177] "Chai Chee Road"                     "Bendemeer Road"                    
[179] "Cavan Road"                         "Hamilton Road"                     
[181] "Syed Alwi Road"                     "1003 Bukit Teresa Road"            
[183] "Jalan Bukit Ho Swee"                "Hawk Arena"                        
[185] "439 Clementi Close"                 "Segar Road"                        
[187] "Woodgrove View"                     "Bloxhome Drive"                    
[189] "Duchess Road"                       "Serangoon Garden Way"              
[191] "Palm Grove Avenue"                  "Jalan Ampang"                      
[193] "Glasgow Road"                       "Sandilands Road"                   
[195] "Sin Ming Road"                      "Charlton Lane"                     
[197] "Lorong Kilat"                       "Joo Chiat Avenue"                  
[199] "Ulu Pandan Park Connector"          "Chiap Guan Avenue"                 
[201] "Joo Chiat Walk"                     "107"                               
[203] "Puay Hee Avenue"                    "Choa Chu Kang Road"                
[205] "Galistan Avenue"                    "19 Harding Road"                   
[207] "Parry Avenue"                       "Swiss Club Avenue"                 
[209] "Dunearn Road"                       "Poh Huat Road"                     
[211] "20 Peirce Road"                     "Faber Drive"                       
[213] "Lorong 6 Realty Park"               "Lichi Avenue"                      
[215] "Woodgrove Drive"                    "Jalan Usaha"                       
[217] "Sungei Kadut Avenue"                "Upper Paya Lebar Road"             
[219] "Paya Lebar Crescent"                "Lorong Ong Lye"                    
[221] "East Coast Avenue"                  "Tai Hwan Heights"                  
[223] "Lothian Terrace"                    "16 The Oval Seletar Aerospace Park"
[225] "5A Bays Water Road"                 "Bodmin Drive"                      
[227] "Carisbrooke Grove"                  "Burghley Drive"                    
[229] "Chuan Walk"                         "Figaro Street"                     
[231] "Palm Drive"                         "Chaun Drive"                       
[233] "Elite Terrace"                      "Canberra Road"                     
[235] "Tuas Road"                          "Tagore Drive"                      
[237] "Tagore Industrial Avenue"           "Tagore Lane"                       
[239] "Mulberry Avenue"                    "Pasir Ris View"                    
[241] "Riverina Crescent"                  "Jalan Pelatina"                    
[243] "Cactus Road"                        "Siglap Bank"                       
[245] "Burnfoot Terrace"                   "Thomson Green"                     
[247] "Harvey Avenue"                      "Sommerville Road"                  
[249] "Jalan Ria"                          "Jalan Riang"                       
[251] "Jalan Ishak"                        "Lorong Marican"                    
[253] "Lorong Biawak"                      "Flora Road"                        
[255] "Kaki Bukit Road 3"                  "Simei Rise"                        
[257] "Beatty Road"                        "Lorong 19 Geylang"                 
[259] "11 Lorong 11 Geylang"               "Lorong 14 Geylang"                 
[261] "Cardiff Grove"                      "Conway Circle"                     
[263] "Jalan Limbok"                       "Lentor Street"                     
[265] "Lentor Link"                        "Lentor Green"                      
[267] "Bedok South Avenue 1"               "Lim Ah Pin Road"                   
[269] "Tampines Street 83"                 "18 Spottiswoode"                   
[271] "Loyang Way"                         "Changi Business Park Vista"        
[273] "Bowmont Gardens"                    "Lorong 22 Geylang"                 
[275] "Paya Lebar Road"                    "Lynwood Grove"                     
[277] "Simon Road"                         "Loewen Road"                       
[279] "Tuas South Avenue 3"                "Yishun Avenue 4"                   
[281] "Coronation Road"                    "Imbiah Road"                       
[283] "China Street"                       "Sixth Lok Yang Road"               
[285] "Woodlands Road"                     "River Valley Road"                 
[287] "Choa Chu Kang Drive"                "Jurong East Street 32"             
[289] "Ang Mo Kio Central 3"               "Bishan Street 23"                  
[291] "Faber Walk"                         "Yishun Street 23"                  
[293] "Benoi Sector"                       "Benoi Road"                        
[295] "Pheng Geck Avenue"                  "Tong Watt Road"                    
[297] "Sea Avenue"                         "Ang Mo Kio Avenue 1"               
[299] "West Coast Way"                     "28A West Jalan Lempeng"            
[301] "28A East Jalan Lempeng"             "13 Clementi Crescent"              
[303] "1007 Bukit Teresa Road"             "1005 Bukit Teresa Road"            
[305] "York Place"                         "Bishan Street 15"                  
[307] "Bulim Avenue"                       "Khiang Guan Avenue"                
[309] "Straits View"                       "13 Leo Drive"                      
[311] "Kinta Road"                         "468I Upper Changi Road"            
[313] "Cove Grove"                         "Riviera Drive"                     
[315] "Bedok Rise"                         "Tampines Street 61"                
[317] "Keppel Bay View"                    "20 Hindhede Place"                 
[319] "Tampines Street 64"                 "Canberra Drive"                    
[321] "Dakota Crescent"                    "Clementi West Street 2"            
[323] "56E Marne Road"                     "Mount Vernon Road"                 
[325] "Marsiling Road"                     "Chong Kuo Road"                    
[327] "Pemimpin Place"                     "Pemimpin Terrace"                  
[329] "15 Lorong 15 Geylang"               "Poh Huat Drive"                    
[331] "Sunrise Terrace"                    "Jalan Isnin"                       
[333] "Jalan Minggu"                      
temp_view <- temp_osm %>% filter(postal == "NIL")
temp_view <- temp_view %>% filter(as.numeric(substr(address, 1, 2)) >= 0)
unique(temp_view$address)
 [1] "710A Ang Mo Kio Central 1"          "714 Ang Mo Kio Central 1"          
 [3] "419 Bedok North Avenue 1"           "420 Bedok North Avenue 1"          
 [5] "980 Buangkok Green"                 "10 Tuas Avenue 10"                 
 [7] "15 Tuas Street"                     "13 Tuas Avenue 13"                 
 [9] "11 Tuas Avenue 11"                  "2 Seragoon North Avenue 2"         
[11] "163 Bukit Batok West Avenue 8"      "162 Bukit Batok West Avenue 8"     
[13] "155 Bukit Batok West Avenue 8"      "12 Artillery Avenue"               
[15] "91 Hougang Avenue 3"                "85 Hougang Avenue 3"               
[17] "114 Bukit Purmei Avenue"            "113 Bukit Purmei Avenue"           
[19] "110 Bukit Purmei Avenue"            "115 Bukit Purmei Avenue"           
[21] "112 Bukit Purmei Avenue"            "111 Bukit Purmei Avenue"           
[23] "103 Henderson Road"                 "44A Beo Crescent"                  
[25] "215 Airport Road"                   "201 Commonwealth Avenue West"      
[27] "50 Clive Road"                      "18 Baboo Lane"                     
[29] "33 Chai Chee Road"                  "34 Chai Chee Road"                 
[31] "35 Chai Chee Road"                  "36 Chai Chee Road"                 
[33] "37 Chai Chee Road"                  "40 Chai Chee Road"                 
[35] "305D Punggol Road"                  "215 Choa Chu Kang Central"         
[37] "216 Choa Chu Kang Central"          "3188 Geylang Bahru"                
[39] "192C Punggol Road"                  "85 Bedok North Avenue 4"           
[41] "13 Jalan Sentosa"                   "32 Chai Chee Road"                 
[43] "73N Jalan Senang"                   "91L Jalan Senang"                  
[45] "28 Lorong 28 Geylang"               "34 Lorong 34 Geylang"              
[47] "89 Bedok North Avenue 4"            "87 Bedok North Avenue 4"           
[49] "88 Bedok North Avenue 4"            "440C Clementi Close"               
[51] "293D Bukit Batok East Avenue 6"     "460A Bukit Batok West Avenue 8"    
[53] "460B Bukit Batok West Avenue 8"     "463B Bukit Batok West Avenue 8"    
[55] "224-J Jalan Endut Senin"            "84 Bedok North Avenue 4"           
[57] "86 Bedok North Avenue 4"            "90 Bedok North Avenue 4"           
[59] "91 Bedok North Avenue 4"            "1003 Bukit Teresa Road"            
[61] "439 Clementi Close"                 "107"                               
[63] "19 Harding Road"                    "20 Peirce Road"                    
[65] "16 The Oval Seletar Aerospace Park" "11 Lorong 11 Geylang"              
[67] "18 Spottiswoode"                    "28A West Jalan Lempeng"            
[69] "28A East Jalan Lempeng"             "13 Clementi Crescent"              
[71] "1007 Bukit Teresa Road"             "1005 Bukit Teresa Road"            
[73] "13 Leo Drive"                       "468I Upper Changi Road"            
[75] "20 Hindhede Place"                  "56E Marne Road"                    
[77] "15 Lorong 15 Geylang"              

Total 77

temp_osm[temp_osm$address == "88 Bedok North Avenue 4", "address"] = "88 BEDOK NORTH STREET 4"
temp_osm[temp_osm$address == "201 Commonwealth Avenue West", "address"] = "201 CLEMENTI AVENUE 6"
temp_osm[temp_osm$address == "112 Bukit Purmei Avenue", "address"] = "112 Bukit Purmei Rd"
temp_osm[temp_osm$address == "114 Bukit Purmei Avenue", "address"] = "114 Bukit Purmei Rd"
temp_osm[temp_osm$address == "35 Chai Chee Road", "address"] = "35 Chai Chee Ave"
temp_osm[temp_osm$address == "40 Chai Chee Road", "address"] = "40 Chai Chee Ave"
temp_osm[temp_osm$address == "87 Bedok North Avenue 4", "address"] = "87 Bedok North Street 4"
temp_osm[temp_osm$address == "34 Chai Chee Road", "address"] = "34 Chai Chee Ave"
temp_osm[temp_osm$address == "36 Chai Chee Road", "address"] = "36 Chai Chee Ave"
temp_osm[temp_osm$address == "163 Bukit Batok West Avenue 8", "address"] = "163 Bukit Batok Street 11"
temp_osm[temp_osm$address == "115 Bukit Purmei Avenue", "address"] = "115 Bukit Purmei Rd"
temp_osm[temp_osm$address == "163 Bukit Batok West Avenue 8", "address"] = "163 Bukit Batok Street 11"
temp_osm[temp_osm$address == "44A Beo Crescent", "address"] = "44A Havelock Rd"
temp_osm[temp_osm$address == "714 Ang Mo Kio Central 1", "address"] = "714 Ang Mo Kio Avenue 6"
temp_osm[temp_osm$address == "163 Bukit Batok West Avenue 8", "address"] = "163 Bukit Batok Street 11"
temp_osm[temp_osm$address == "113 Bukit Purmei Avenue", "address"] = "113 Bukit Purmei Rd"
temp_osm[temp_osm$address == "162 Bukit Batok West Avenue 8", "address"] = "162 Bukit Batok Street 11"
temp_osm[temp_osm$address == "113 Bukit Purmei Avenue", "address"] = "113 Bukit Purmei Rd"
temp_osm[temp_osm$address == "103 Henderson Road", "address"] = "103 Henderson Crescent"
temp_osm[temp_osm$address == "91 Bedok North Avenue 4", "address"] = "91 Bedok North Street 4"
temp_osm[temp_osm$address == "460B Bukit Batok West Avenue 8", "address"] = "460B Bukit Batok West Avenue 9"
temp_osm[temp_osm$address == "90 Bedok North Avenue 4", "address"] = "90 Bedok North Street 4"
temp_osm[temp_osm$address == "110 Bukit Purmei Avenue", "address"] = "110 Bukit Purmei Rd"
temp_osm[temp_osm$address == "420 Bedok North Avenue 1", "address"] = "420 Bedok North Street 1"
temp_osm[temp_osm$address == "419 Bedok North Avenue 1", "address"] = "419 Bedok North Street 1"
temp_osm[temp_osm$address == "37 Chai Chee Road", "address"] = "37 Chai Chee Ave"
temp_osm[temp_osm$address == "33 Chai Chee Road", "address"] = "33 Chai Chee Ave"
temp_osm[temp_osm$address == "32 Chai Chee Road", "address"] = "32 Chai Chee Ave"
temp_osm[temp_osm$address == "89 Bedok North Avenue 4", "address"] = "89 Bedok North Street 4"
temp_osm[temp_osm$address == "86 Bedok North Avenue 4", "address"] = "86 Bedok North Street 4"
temp_osm[temp_osm$address == "293D Bukit Batok East Avenue 6", "address"] = "293D Bukit Batok Street 21"
temp_osm[temp_osm$address == "155 Bukit Batok West Avenue 8", "address"] = "155 Bukit Batok Street 11"
temp_osm[temp_osm$address == "460A Bukit Batok West Avenue 8", "address"] = "460A Bukit Batok West Avenue 9"
temp_osm[temp_osm$address == "463B Bukit Batok West Avenue 8", "address"] = "463B Bukit Batok West Avenue 9"
temp_osm[temp_osm$address == "84 Bedok North Avenue 4", "address"] = "84 Bedok North Street 4"
temp_osm[temp_osm$address == "85 Bedok North Avenue 4", "address"] = "85 Bedok North Street 4"
temp_osm[temp_osm$address == "111 Bukit Purmei Avenue", "address"] = "111 Bukit Purmei Rd"
temp_osm[temp_osm$address == "440C Clementi Close", "address"] = "440C Clementi Ave 3"
temp_osm[temp_osm$address == "439 Clementi Close", "address"] = "439 Clementi Ave 3"
temp_osm[temp_osm$address == "710A Ang Mo Kio Central 1", "address"] = "710A Ang Mo Kio Avenue 8"
temp_osm[temp_osm$address == "192C Punggol Road", "address"] = "192C Punggol Central"
temp_osm[temp_osm$address == "305D Punggol Road", "address"] = "305D Punggol Dr"
temp_osm[temp_osm$address == "980 Buangkok Green", "address"] = "980 Buangkok Cres"

Update 42 useful ones - HDB - 2 postal below

Total left = 30

Rerun get address for those updated (POSTAL NIL - 42)

 

upd_proc_osm <- temp_osm %>% filter(postal == "NIL")
addr_lst <- sort(unique(upd_proc_osm$address))
postal <- get_postal(addr_lst)

write_rds(postal, "data/fyp_preprocessing/osm_append_bldgs_postal.rds")
OSM_BLDGS_POSTAL <- read_rds("data/fyp_preprocessing/osm_bldgs_postal.rds")

OSM_BLDGS_APPEND_POSTAL <- read_rds("data/fyp_preprocessing/osm_append_bldgs_postal.rds")

OSM_COMBINE_POSTAL <- rbind(OSM_BLDGS_POSTAL, OSM_BLDGS_APPEND_POSTAL)
temp_osm$postal <- NULL
temp_osm <- left_join(temp_osm, OSM_COMBINE_POSTAL, by=c("address" = "address"))
temp_osm[temp_osm$address == "215 Choa Chu Kang Central", "postal"] = "680215"
temp_osm[temp_osm$address == "216 Choa Chu Kang Central", "postal"] = "680216"
temp_view <- temp_osm %>% filter(postal == "NIL")
temp_view <- temp_view %>% filter(as.numeric(substr(address, 1, 2)) >= 0)
unique(temp_view$address)
 [1] "10 Tuas Avenue 10"                  "15 Tuas Street"                    
 [3] "13 Tuas Avenue 13"                  "11 Tuas Avenue 11"                 
 [5] "2 Seragoon North Avenue 2"          "12 Artillery Avenue"               
 [7] "91 Hougang Avenue 3"                "85 Hougang Avenue 3"               
 [9] "215 Airport Road"                   "50 Clive Road"                     
[11] "18 Baboo Lane"                      "3188 Geylang Bahru"                
[13] "13 Jalan Sentosa"                   "73N Jalan Senang"                  
[15] "91L Jalan Senang"                   "28 Lorong 28 Geylang"              
[17] "34 Lorong 34 Geylang"               "224-J Jalan Endut Senin"           
[19] "1003 Bukit Teresa Road"             "107"                               
[21] "19 Harding Road"                    "20 Peirce Road"                    
[23] "16 The Oval Seletar Aerospace Park" "11 Lorong 11 Geylang"              
[25] "18 Spottiswoode"                    "28A West Jalan Lempeng"            
[27] "28A East Jalan Lempeng"             "13 Clementi Crescent"              
[29] "1007 Bukit Teresa Road"             "1005 Bukit Teresa Road"            
[31] "13 Leo Drive"                       "468I Upper Changi Road"            
[33] "20 Hindhede Place"                  "56E Marne Road"                    
[35] "15 Lorong 15 Geylang"              

35 remaining - correct

4.2 Preparing HDB Property Dataset

HDB Property dataset lacks postal code which allows us to combine the attributes with the geospatial datasets. Onemap search API is used to search for the postal code with the dataset’s address line.

Adding Postal Codes to HDB Property Datasets - prepare to combine with HDB Buildings geospatial data

Ref https://renjieteo-is415.netlify.app/exercises/thex03#create-a-list-storing-unique-addressespostal-codeshttps://renjieteo-is415.netlify.app/exercises/thex03#create-a-list-storing-unique-addressespostal-codes

HDB_PROPERTY <- RAW_HDB_PROPERTY %>%
  mutate(RAW_HDB_PROPERTY, address = paste(blk_no, street))

Obtain postal codes from OneMap API

addr_lst <- sort(unique(HDB_PROPERTY$address))
postal <- get_postal(addr_lst)

write_rds(postal, "data/fyp_preprocessing/hdb_property_postal.rds")

Combine HDB Property data to HDB Buildings dataset

postal <- read_rds("data/fyp_preprocessing/hdb_property_postal.rds")
temp_hdb_property <- left_join(HDB_PROPERTY, postal, by=c("address" = "address"))
temp_hdb_property <- mutate(temp_hdb_property, postal_check = 
                     is.na(as.numeric(postal)) == FALSE)

temp_hdb_property %>% filter(postal_check == FALSE)
  blk_no             street max_floor_lvl year_completed residential commercial
1    215 CHOA CHU KANG CTRL            11           1989           Y          Y
2    216 CHOA CHU KANG CTRL             4           1989           Y          N
  market_hawker miscellaneous multistorey_carpark precinct_pavilion
1             N             N                   N                 N
2             N             N                   N                 N
  bldg_contract_town total_dwelling_units X1room_sold X2room_sold X3room_sold
1                CCK                   90           0           0           0
2                CCK                   16           0           0           0
  X4room_sold X5room_sold exec_sold multigen_sold studio_apartment_sold
1          90           0         0             0                     0
2          16           0         0             0                     0
  X1room_rental X2room_rental X3room_rental other_room_rental
1             0             0             0                 0
2             0             0             0                 0
                 address postal postal_check
1 215 CHOA CHU KANG CTRL    NIL        FALSE
2 216 CHOA CHU KANG CTRL    NIL        FALSE
temp_hdb_property[temp_hdb_property$address == "215 CHOA CHU KANG CTRL", "postal"] = 680215
temp_hdb_property[temp_hdb_property$address == "216 CHOA CHU KANG CTRL", "postal"] = 680216

temp_hdb_property %>% filter(postal_check == FALSE)
  blk_no             street max_floor_lvl year_completed residential commercial
1    215 CHOA CHU KANG CTRL            11           1989           Y          Y
2    216 CHOA CHU KANG CTRL             4           1989           Y          N
  market_hawker miscellaneous multistorey_carpark precinct_pavilion
1             N             N                   N                 N
2             N             N                   N                 N
  bldg_contract_town total_dwelling_units X1room_sold X2room_sold X3room_sold
1                CCK                   90           0           0           0
2                CCK                   16           0           0           0
  X4room_sold X5room_sold exec_sold multigen_sold studio_apartment_sold
1          90           0         0             0                     0
2          16           0         0             0                     0
  X1room_rental X2room_rental X3room_rental other_room_rental
1             0             0             0                 0
2             0             0             0                 0
                 address postal postal_check
1 215 CHOA CHU KANG CTRL 680215        FALSE
2 216 CHOA CHU KANG CTRL 680216        FALSE

5 Combination of Data

5.1 OSM

osm_property_bldgs <- left_join(temp_osm, temp_hdb_property, by=c("postal" = "postal"))
write_rds(osm_property_bldgs, "data/fyp_preprocessing/osm_property_bldgs.rds")
osm_property_bldgs <- read_rds("data/fyp_preprocessing/osm_property_bldgs.rds")
tmap_options(check.and.fix = TRUE)
tmap_mode("view")
tm_shape(osm_property_bldgs %>% filter(bldg_contract_town == "CCK")) +
  tm_fill(col = "cyan")

5.2 Data Gov

Combine the property data to hdb data

datagov_hdb_property_bldgs <- left_join(hdb_bldgs, temp_hdb_property, by=c("POSTAL_COD" = "postal"))
write_rds(datagov_hdb_property_bldgs, "data/fyp_preprocessing/datagov_hdb_property_bldgs.rds")
datagov_hdb_property_bldgs <- read_rds("data/fyp_preprocessing/datagov_hdb_property_bldgs.rds")
tmap_options(check.and.fix = TRUE)
tmap_mode("view")
tm_shape(datagov_hdb_property_bldgs %>% filter(bldg_contract_town == "CCK")) +
  tm_fill(col = "cyan")

6 Combining Datasets

Based on analysis, there are pros and cons of using each dataset:

  • OSM

    • Pros - more up to date building data - eg. Tengah

Way forward

  • Use HDB datagov as base

  • Combine newer buildings / non-overlapping buildings from OSM that has data

Test - what is missing?

extract_postal <- datagov_hdb_property_bldgs$POSTAL_COD

missing_bldgs <- temp_hdb_property %>% filter(!(postal %in% extract_postal))
missing_bldgs
    blk_no              street max_floor_lvl year_completed residential
1        1       TAMPINES WALK             7           2016           N
2       11          HOLLAND DR            22           1974           Y
3      111     PLANTATION CRES             2           2024           N
4     111A     PLANTATION CRES            14           2023           Y
5     111B     PLANTATION CRES            14           2023           Y
6     111C     PLANTATION CRES            14           2023           Y
7      112     PLANTATION CRES             5           2024           N
8     112A     PLANTATION CRES            14           2023           Y
9     112B     PLANTATION CRES            14           2023           Y
10    113A     PLANTATION CRES            14           2023           Y
11    113B     PLANTATION CRES            14           2023           Y
12    114A     PLANTATION CRES            14           2023           Y
13    114B     PLANTATION CRES            14           2023           Y
14    116A     PLANTATION CRES            14           2024           Y
15    116B     PLANTATION CRES            14           2024           Y
16    117A     PLANTATION CRES            14           2024           Y
17    118A     PLANTATION CRES            11           2024           Y
18    123A           TENGAH DR            14           2024           Y
19    123B           TENGAH DR            14           2024           Y
20    123C           TENGAH DR            14           2024           Y
21    125A           TENGAH DR            14           2023           Y
22    125B           TENGAH DR            14           2023           Y
23    126A           TENGAH DR            14           2023           Y
24    126B           TENGAH DR            12           2023           Y
25    126C           TENGAH DR            14           2024           Y
26    127A     PLANTATION CRES            11           2023           Y
27    127B     PLANTATION CRES            14           2023           Y
28    128A     PLANTATION CRES            15           2023           Y
29    128B     PLANTATION CRES            15           2023           Y
30    129A     PLANTATION CRES            14           2023           Y
31    129B     PLANTATION CRES            14           2023           Y
32    129C     PLANTATION CRES            15           2023           Y
33    131A      TENGAH GDN AVE            14           2023           Y
34    131B      TENGAH GDN AVE            15           2023           Y
35    131C      TENGAH GDN AVE            15           2023           Y
36    131D      TENGAH GDN AVE            15           2023           Y
37     132      TENGAH GDN AVE             1           2024           N
38    132A      TENGAH GDN AVE            14           2023           Y
39    132B      TENGAH GDN AVE            14           2023           Y
40    132C      TENGAH GDN AVE            14           2023           Y
41     133      TENGAH GDN AVE             1           2024           N
42    133A      TENGAH GDN AVE            15           2023           Y
43    133B      TENGAH GDN AVE            15           2023           Y
44    133C      TENGAH GDN AVE            15           2023           Y
45    141A SERANGOON NTH AVE 2             5           1995           N
46      15            BEACH RD            20           1974           Y
47     170    SENGKANG EAST DR             1           2023           N
48     171    SENGKANG EAST DR             1           2024           N
49    172C    SENGKANG EAST DR            18           2023           Y
50    172D    SENGKANG EAST DR            18           2023           Y
51     173    SENGKANG EAST DR             1           2023           N
52    173A    SENGKANG EAST DR            18           2023           Y
53    173B    SENGKANG EAST DR            18           2023           Y
54     175    SENGKANG EAST DR             1           2023           N
55     187        MARSILING RD             4           2023           N
56    187C        MARSILING RD             1           2023           N
57     188        MARSILING RD             1           2023           N
58     189        MARSILING RD             1           2023           N
59       2          QUEEN'S RD            12           1973           Y
60     208      WOODLEIGH LINK             1           2023           N
61      21       LOR 3 GEYLANG             1           2023           N
62      22       LOR 3 GEYLANG             1           2023           N
63     237         BOON LAY DR             5           2023           N
64    237A         BOON LAY DR            15           2023           Y
65    237B         BOON LAY DR            17           2023           Y
66    238A         BOON LAY DR            17           2023           Y
67    238B         BOON LAY DR            17           2023           Y
68    239A         BOON LAY DR            17           2023           Y
69    239B         BOON LAY DR            15           2023           Y
70     266        KIM KEAT AVE             1           2023           N
71       3        MARSILING RD            13           1973           Y
72       3          QUEEN'S RD            12           1973           Y
73      33             PK CRES             6           1974           N
74      34     TANGLIN HALT RD            10           1962           Y
75      35     TANGLIN HALT RD            10           1962           Y
76     358            UBI RD 3             1           2023           N
77      36     TANGLIN HALT RD            10           1962           Y
78      37     TANGLIN HALT RD            10           1962           Y
79      38           PINE LANE             1           2023           N
80      38     TANGLIN HALT RD            10           1962           Y
81     381      YISHUN RING RD             1           2023           N
82     384        YISHUN AVE 6             1           2023           N
83      39            JLN TIGA            19           2003           Y
84       4        MARSILING RD            13           1973           Y
85    400D       FERNVALE LANE             1           2023           N
86     401       FERNVALE LANE             1           2024           N
87    401C       FERNVALE LANE             1           2023           N
88      42     TANGLIN HALT RD            10           1962           Y
89      43     TANGLIN HALT RD            10           1962           Y
90    431A       NORTHSHORE DR             1           2024           N
91    431B       NORTHSHORE DR            22           2023           Y
92    431C       NORTHSHORE DR            22           2024           Y
93    432A       NORTHSHORE DR            22           2023           Y
94    432B       NORTHSHORE DR            22           2023           Y
95     433       NORTHSHORE DR             1           2023           N
96    433A       NORTHSHORE DR            22           2023           Y
97    433B       NORTHSHORE DR            22           2023           Y
98     435       NORTHSHORE DR             4           2024           N
99    437A       NORTHSHORE DR            19           2024           Y
100   437B       NORTHSHORE DR            26           2024           Y
101   438A       NORTHSHORE DR            24           2024           Y
102   438B       NORTHSHORE DR            24           2024           Y
103   446A         PUNGGOL WAY            21           2024           Y
104   446B         PUNGGOL WAY            22           2024           Y
105   448B         PUNGGOL WAY            14           2024           Y
106    459   SENGKANG WEST WAY             1           2023           N
107    461   SENGKANG WEST WAY             1           2023           N
108    463   SENGKANG WEST WAY             1           2023           N
109    464      CLEMENTI AVE 1             1           2023           N
110    464         FERNVALE RD             1           2024           N
111   464A         FERNVALE RD            24           2023           Y
112   464B         FERNVALE RD            24           2023           Y
113    465         FERNVALE RD             6           2023           N
114   465A         FERNVALE RD            24           2023           Y
115   465B         FERNVALE RD            24           2023           Y
116    466         FERNVALE RD             1           2024           N
117   466A         FERNVALE RD            21           2023           Y
118   466B         FERNVALE RD            21           2023           Y
119      5            BEACH RD            16           1968           Y
120      5            JLN BATU            10           1962           Y
121     52             KENT RD            12           1981           Y
122     54             KENT RD            25           1981           Y
123     56         C'WEALTH DR            10           1962           Y
124      6            JLN BATU            10           1962           Y
125     60         C'WEALTH DR            10           1963           Y
126     62         C'WEALTH DR            10           1963           Y
127    637      TAMPINES ST 62             1           2024           N
128    639      TAMPINES ST 62             1           2023           N
129    641      TAMPINES ST 62             1           2023           N
130    662      TAMPINES ST 64             5           2023           N
131   662A      TAMPINES ST 64            15           2023           Y
132   662B      TAMPINES ST 64            15           2023           Y
133   662C      TAMPINES ST 64            16           2023           Y
134   663A      TAMPINES ST 64            16           2024           Y
135   663B      TAMPINES ST 64            16           2024           Y
136   663C      TAMPINES ST 64            16           2023           Y
137    75A          CIRCUIT RD            19           2024           Y
138    75B          CIRCUIT RD            19           2024           Y
139     76          CIRCUIT RD             5           2024           N
140    76A          CIRCUIT RD            17           2024           Y
141    801     WEST COAST CRES             5           2023           N
142   801A     WEST COAST CRES            32           2023           Y
143   801B     WEST COAST CRES            32           2023           Y
144   801C     WEST COAST CRES            32           2023           Y
145    820      KEAT HONG LINK             1           2024           N
146   858C       TAMPINES WALK            14           2023           Y
147   858D       TAMPINES WALK            13           2023           Y
148   858E       TAMPINES WALK             4           2023           N
149   859C       TAMPINES WALK            14           2023           Y
150   859D       TAMPINES WALK            12           2023           Y
151   860C       TAMPINES WALK            15           2023           Y
152   860D       TAMPINES WALK            13           2023           Y
153   890D      TAMPINES AVE 1             1           2014           N
154   951A      TAMPINES ST 96            17           2024           Y
155   951B      TAMPINES ST 96            17           2024           Y
156   951C      TAMPINES ST 96            16           2024           Y
157    952      TAMPINES ST 96             3           2023           N
158   952A      TAMPINES ST 96            17           2024           Y
159   952B      TAMPINES ST 96            17           2024           Y
160   952C      TAMPINES ST 96            16           2024           Y
161   953A      TAMPINES ST 96            17           2023           Y
162   953B      TAMPINES ST 96            17           2023           Y
163   953C      TAMPINES ST 96            17           2023           Y
164    954      TAMPINES ST 96             1           2023           N
165   954A      TAMPINES ST 96            16           2024           Y
166   954B      TAMPINES ST 96            16           2024           Y
167   954C      TAMPINES ST 96            17           2023           Y
168   954D      TAMPINES ST 96            17           2023           Y
    commercial market_hawker miscellaneous multistorey_carpark
1            N             N             Y                   N
2            N             N             Y                   N
3            N             N             Y                   N
4            Y             N             Y                   N
5            N             N             N                   N
6            N             N             N                   N
7            N             N             N                   Y
8            N             N             N                   N
9            N             N             N                   N
10           N             N             N                   N
11           N             N             N                   N
12           N             N             N                   N
13           N             N             N                   N
14           N             N             N                   N
15           N             N             N                   N
16           N             N             N                   N
17           N             N             N                   N
18           N             N             N                   N
19           N             N             N                   N
20           N             N             N                   N
21           N             N             N                   N
22           N             N             N                   N
23           Y             N             N                   N
24           Y             N             Y                   N
25           Y             N             Y                   N
26           Y             N             Y                   N
27           Y             N             N                   N
28           N             N             N                   N
29           N             N             N                   N
30           N             N             N                   N
31           N             N             N                   N
32           N             N             N                   N
33           N             N             Y                   N
34           N             N             Y                   N
35           N             N             Y                   N
36           N             N             N                   N
37           N             N             N                   N
38           N             N             N                   N
39           N             N             N                   N
40           N             N             N                   N
41           N             N             N                   N
42           N             N             N                   N
43           N             N             N                   N
44           N             N             N                   N
45           N             N             N                   Y
46           Y             N             N                   N
47           N             N             N                   N
48           Y             N             N                   N
49           N             N             N                   N
50           N             N             N                   N
51           N             N             N                   N
52           N             N             N                   N
53           N             N             N                   N
54           N             N             N                   N
55           N             N             Y                   Y
56           Y             N             N                   N
57           N             N             N                   N
58           N             N             N                   N
59           N             N             Y                   N
60           N             N             N                   N
61           N             N             Y                   N
62           N             N             N                   N
63           N             N             N                   Y
64           N             N             N                   N
65           N             N             N                   N
66           N             N             N                   N
67           N             N             N                   N
68           N             N             N                   N
69           N             N             N                   N
70           N             N             N                   N
71           N             N             Y                   N
72           Y             N             Y                   N
73           N             N             N                   Y
74           N             N             N                   N
75           N             N             N                   N
76           N             N             N                   N
77           N             N             N                   N
78           N             N             N                   N
79           N             N             N                   N
80           N             N             N                   N
81           N             N             N                   N
82           N             N             N                   N
83           Y             N             N                   N
84           N             N             Y                   N
85           N             N             N                   N
86           N             N             Y                   N
87           N             N             N                   N
88           N             N             N                   N
89           N             N             N                   N
90           Y             N             N                   N
91           N             N             N                   N
92           N             N             N                   N
93           N             N             N                   N
94           Y             N             N                   N
95           N             N             N                   N
96           N             N             N                   N
97           N             N             Y                   N
98           N             N             N                   Y
99           N             N             N                   N
100          N             N             N                   N
101          N             N             N                   N
102          N             N             N                   N
103          N             N             N                   N
104          N             N             Y                   N
105          N             N             Y                   N
106          N             N             N                   N
107          N             N             N                   N
108          N             N             N                   N
109          N             N             N                   N
110          N             N             N                   N
111          N             N             N                   N
112          N             N             N                   N
113          Y             N             Y                   Y
114          N             N             N                   N
115          N             N             N                   N
116          N             N             N                   N
117          N             N             N                   N
118          N             N             N                   N
119          N             N             Y                   N
120          N             N             N                   N
121          N             N             Y                   N
122          N             N             N                   N
123          N             N             N                   N
124          N             N             N                   N
125          N             N             N                   N
126          N             N             N                   N
127          N             N             N                   N
128          N             N             N                   N
129          N             N             N                   N
130          N             N             N                   Y
131          N             N             N                   N
132          N             N             Y                   N
133          N             N             Y                   N
134          N             N             Y                   N
135          N             N             N                   N
136          N             N             N                   N
137          N             N             N                   N
138          N             N             N                   N
139          Y             N             Y                   Y
140          N             N             Y                   N
141          Y             N             Y                   Y
142          N             N             N                   N
143          N             N             N                   N
144          N             N             N                   N
145          N             N             N                   N
146          N             N             N                   N
147          N             N             N                   N
148          N             N             Y                   Y
149          N             N             N                   N
150          N             N             N                   N
151          N             N             N                   N
152          N             N             N                   N
153          N             N             N                   N
154          N             N             N                   N
155          N             N             N                   N
156          N             N             N                   N
157          N             N             N                   Y
158          N             N             N                   N
159          N             N             N                   N
160          N             N             N                   N
161          N             N             N                   N
162          N             N             N                   N
163          N             N             N                   N
164          N             N             N                   N
165          N             N             Y                   N
166          N             N             Y                   N
167          Y             N             N                   N
168          Y             N             N                   N
    precinct_pavilion bldg_contract_town total_dwelling_units X1room_sold
1                   N                TAP                    0           0
2                   N                 QT                  371           0
3                   Y                 TG                    0           0
4                   N                 TG                  109           0
5                   N                 TG                  181           0
6                   N                 TG                   81           0
7                   N                 TG                    0           0
8                   N                 TG                  143           0
9                   N                 TG                  182           0
10                  N                 TG                  140           0
11                  N                 TG                  130           0
12                  N                 TG                  114           0
13                  N                 TG                  113           0
14                  N                 TG                  176           0
15                  N                 TG                  139           0
16                  N                 TG                   75           0
17                  N                 TG                  117           0
18                  N                 TG                   46           0
19                  N                 TG                  111           0
20                  N                 TG                   91           0
21                  N                 TG                  168           0
22                  N                 TG                  164           0
23                  N                 TG                   57           0
24                  N                 TG                   87           0
25                  N                 TG                   70           0
26                  N                 TG                   33           0
27                  N                 TG                   72           0
28                  N                 TG                  125           0
29                  N                 TG                  120           0
30                  N                 TG                   48           0
31                  N                 TG                  114           0
32                  N                 TG                  114           0
33                  N                 TG                   70           0
34                  N                 TG                  111           0
35                  N                 TG                  111           0
36                  N                 TG                   87           0
37                  Y                 TG                    0           0
38                  N                 TG                  132           0
39                  N                 TG                  117           0
40                  N                 TG                  132           0
41                  Y                 TG                    0           0
42                  N                 TG                  121           0
43                  N                 TG                  121           0
44                  N                 TG                  138           0
45                  N                SGN                    0           0
46                  N                KWN                   76           0
47                  Y                 SK                    0           0
48                  N                 SK                    0           0
49                  N                 SK                  174           0
50                  N                 SK                  126           0
51                  Y                 SK                    0           0
52                  N                 SK                  126           0
53                  N                 SK                  174           0
54                  Y                 SK                    0           0
55                  N                 WL                    0           0
56                  N                 WL                    0           0
57                  Y                 WL                    0           0
58                  Y                 WL                    0           0
59                  N                 BT                   66           0
60                  Y                 TP                    0           0
61                  N                KWN                    0           0
62                  Y                KWN                    0           0
63                  N                 JW                    0           0
64                  N                 JW                   80           0
65                  N                 JW                  158           0
66                  N                 JW                  144           0
67                  N                 JW                  160           0
68                  N                 JW                  137           0
69                  N                 JW                   96           0
70                  Y                 TP                    0           0
71                  N                 WL                  456           0
72                  N                 BT                  150           0
73                  N                 CT                    0           0
74                  N                 QT                  117           0
75                  N                 QT                  119           0
76                  Y                 GL                    0           0
77                  N                 QT                  117           0
78                  N                 QT                  118           0
79                  Y                 GL                    0           0
80                  N                 QT                  116           0
81                  Y                 YS                    0           0
82                  Y                 YS                    0           0
83                  N                 GL                   70           0
84                  N                 WL                  412           0
85                  Y                 SK                    0           0
86                  N                 SK                    0           0
87                  Y                 SK                    0           0
88                  N                 QT                  118           0
89                  N                 QT                  114           0
90                  N                 PG                    0           0
91                  N                 PG                  144           0
92                  N                 PG                  158           0
93                  N                 PG                  176           0
94                  N                 PG                  160           0
95                  N                 PG                    0           0
96                  N                 PG                  146           0
97                  N                 PG                  156           0
98                  Y                 PG                    0           0
99                  N                 PG                  111           0
100                 N                 PG                  183           0
101                 N                 PG                  241           0
102                 N                 PG                  273           0
103                 N                 PG                  140           0
104                 N                 PG                  318           0
105                 N                 PG                  204           0
106                 Y                 SK                    0           0
107                 Y                 SK                    0           0
108                 Y                 SK                    0           0
109                 Y                 CL                    0           0
110                 Y                 SK                    0           0
111                 N                 SK                  177           0
112                 N                 SK                  179           0
113                 N                 SK                    0           0
114                 N                 SK                  177           0
115                 N                 SK                  178           0
116                 Y                 SK                    0           0
117                 N                 SK                  111           0
118                 N                 SK                  111           0
119                 N                KWN                  336           0
120                 N                KWN                  110           0
121                 N                KWN                  127           0
122                 N                KWN                   96           0
123                 N                 QT                  118           0
124                 N                KWN                  116           0
125                 N                 QT                  118           0
126                 N                 QT                  119           0
127                 N                TAP                    0           0
128                 N                TAP                    0           0
129                 N                TAP                    0           0
130                 N                TAP                    0           0
131                 N                TAP                  139           0
132                 N                TAP                  128           0
133                 N                TAP                   56           0
134                 N                TAP                   56           0
135                 N                TAP                  134           0
136                 N                TAP                  136           0
137                 N                 GL                  148           0
138                 N                 GL                  260           0
139                 N                 GL                    0           0
140                 N                 GL                  222           0
141                 Y                 CL                    0           0
142                 N                 CL                  198           0
143                 N                 CL                  197           0
144                 N                 CL                  302           0
145                 Y                CCK                    0           0
146                 N                TAP                  181           0
147                 N                TAP                   47           0
148                 N                TAP                    0           0
149                 N                TAP                  181           0
150                 N                TAP                  120           0
151                 N                TAP                   56           0
152                 N                TAP                   72           0
153                 Y                TAP                    0           0
154                 N                TAP                   87           0
155                 N                TAP                   87           0
156                 N                TAP                   58           0
157                 N                TAP                    0           0
158                 N                TAP                   84           0
159                 N                TAP                   84           0
160                 N                TAP                   55           0
161                 N                TAP                   62           0
162                 N                TAP                   62           0
163                 N                TAP                   93           0
164                 N                TAP                    0           0
165                 N                TAP                   93           0
166                 N                TAP                   90           0
167                 N                TAP                  129           0
168                 N                TAP                  102           0
    X2room_sold X3room_sold X4room_sold X5room_sold exec_sold multigen_sold
1             0           0           0           0         0             0
2             0         280          84           7         0             0
3             0           0           0           0         0             0
4             0           0          57          52         0             0
5           129          26          26           0         0             0
6             0           0          21          60         0             0
7             0           0           0           0         0             0
8            91          26          26           0         0             0
9           130          26          26           0         0             0
10           89          26          25           0         0             0
11          104           0          26           0         0             0
12            0           0          40          74         0             0
13            0           0          40          73         0             0
14           74           0          76          26         0             0
15           88           0          22          29         0             0
16            0           0          24          51         0             0
17           40          39          38           0         0             0
18            0           0          20          26         0             0
19           40          13          46          12         0             0
20            0           0          69          22         0             0
21           91          19          36          22         0             0
22           89          18          35          22         0             0
23            0          10          13          34         0             0
24           18          18          39          12         0             0
25            0           0          21          49         0             0
26            0          21          12           0         0             0
27            0           0          21          51         0             0
28           74           0          26          25         0             0
29           72           0          24          24         0             0
30            0           0          22          26         0             0
31           42          13          47          12         0             0
32            0           0          53          61         0             0
33            0           0          24          46         0             0
34           46          26          39           0         0             0
35           46          26          39           0         0             0
36            0          39          48           0         0             0
37            0           0           0           0         0             0
38           84           0          48           0         0             0
39            0           0          36          81         0             0
40           84           0          48           0         0             0
41            0           0           0           0         0             0
42            0           0          36          85         0             0
43            0           0          36          85         0             0
44           86           0          52           0         0             0
45            0           0           0           0         0             0
46            0           0          76           0         0             0
47            0           0           0           0         0             0
48            0           0           0           0         0             0
49          142          32           0           0         0             0
50           64           0          62           0         0             0
51            0           0           0           0         0             0
52           64           0          62           0         0             0
53          142          32           0           0         0             0
54            0           0           0           0         0             0
55            0           0           0           0         0             0
56            0           0           0           0         0             0
57            0           0           0           0         0             0
58            0           0           0           0         0             0
59            0          10          56           0         0             0
60            0           0           0           0         0             0
61            0           0           0           0         0             0
62            0           0           0           0         0             0
63            0           0           0           0         0             0
64            0           0          26          54         0             0
65           78          32          48           0         0             0
66           80           0          64           0         0             0
67           80          32          48           0         0             0
68           75           0          62           0         0             0
69            0           0          26          70         0             0
70            0           0           0           0         0             0
71            0           0           0           0         0             0
72            0          28         122           0         0             0
73            0           0           0           0         0             0
74            0           0           0           0         0             0
75            0           0           0           0         0             0
76            0           0           0           0         0             0
77            0           0           0           0         0             0
78            0           0           0           0         0             0
79            0           0           0           0         0             0
80            0           0           0           0         0             0
81            0           0           0           0         0             0
82            0           0           0           0         0             0
83            0           0          36          34         0             0
84            0           0           0           0         0             0
85            0           0           0           0         0             0
86            0           0           0           0         0             0
87            0           0           0           0         0             0
88            0           0           0           0         0             0
89            0           0           0           0         0             0
90            0           0           0           0         0             0
91          103          20          21           0         0             0
92           82          30          46           0         0             0
93          120          20          36           0         0             0
94            0           0         100          60         0             0
95            0           0           0           0         0             0
96            0           0          84          62         0             0
97           82          28          46           0         0             0
98            0           0           0           0         0             0
99            0           0          54          57         0             0
100           0           0          99          84         0             0
101         207          34           0           0         0             0
102         227          46           0           0         0             0
103           0          40          60          40         0             0
104         151           0          84          83         0             0
105         103          26          40          35         0             0
106           0           0           0           0         0             0
107           0           0           0           0         0             0
108           0           0           0           0         0             0
109           0           0           0           0         0             0
110           0           0           0           0         0             0
111         108          23          46           0         0             0
112         110          23          46           0         0             0
113           0           0           0           0         0             0
114         109          23          45           0         0             0
115         110          23          45           0         0             0
116           0           0           0           0         0             0
117           0           0          17          94         0             0
118           0           0          17          94         0             0
119           0           0           0           0         0             0
120           0         100          10           0         0             0
121           0           0         127           0         0             0
122           0           0           0          96         0             0
123           0           0           0           0         0             0
124           0         112           4           0         0             0
125           0           0           0           0         0             0
126           0           0           0           0         0             0
127           0           0           0           0         0             0
128           0           0           0           0         0             0
129           0           0           0           0         0             0
130           0           0           0           0         0             0
131           0           0          70          69         0             0
132           0           0          64          64         0             0
133           0           0          30          26         0             0
134           0           0          30          26         0             0
135           0           0          68          66         0             0
136           0           0          68          68         0             0
137          15          51          82           0         0             0
138           0          70         190           0         0             0
139           0           0           0           0         0             0
140          94          32          64          32         0             0
141           0           0           0           0         0             0
142          20          91          59          28         0             0
143          20          90          59          28         0             0
144           0         116         124          62         0             0
145           0           0           0           0         0             0
146          78          26          51          26         0             0
147           0           0          23          24         0             0
148           0           0           0           0         0             0
149          78          26          52          25         0             0
150           0           0          54          66         0             0
151           0          14          14          28         0             0
152           0          24          24          24         0             0
153           0           0           0           0         0             0
154           0           0          45          42         0             0
155           0           0          45          42         0             0
156           0           0          29          29         0             0
157           0           0           0           0         0             0
158           0           0          43          41         0             0
159           0           0          43          41         0             0
160           0           0          28          27         0             0
161           0           0          31          31         0             0
162           0           0          31          31         0             0
163           0           0          47          46         0             0
164           0           0           0           0         0             0
165          43          30          20           0         0             0
166          42          28          20           0         0             0
167          45          30          54           0         0             0
168          30          16          56           0         0             0
    studio_apartment_sold X1room_rental X2room_rental X3room_rental
1                       0             0             0             0
2                       0             0             0             0
3                       0             0             0             0
4                       0             0             0             0
5                       0             0             0             0
6                       0             0             0             0
7                       0             0             0             0
8                       0             0             0             0
9                       0             0             0             0
10                      0             0             0             0
11                      0             0             0             0
12                      0             0             0             0
13                      0             0             0             0
14                      0             0             0             0
15                      0             0             0             0
16                      0             0             0             0
17                      0             0             0             0
18                      0             0             0             0
19                      0             0             0             0
20                      0             0             0             0
21                      0             0             0             0
22                      0             0             0             0
23                      0             0             0             0
24                      0             0             0             0
25                      0             0             0             0
26                      0             0             0             0
27                      0             0             0             0
28                      0             0             0             0
29                      0             0             0             0
30                      0             0             0             0
31                      0             0             0             0
32                      0             0             0             0
33                      0             0             0             0
34                      0             0             0             0
35                      0             0             0             0
36                      0             0             0             0
37                      0             0             0             0
38                      0             0             0             0
39                      0             0             0             0
40                      0             0             0             0
41                      0             0             0             0
42                      0             0             0             0
43                      0             0             0             0
44                      0             0             0             0
45                      0             0             0             0
46                      0             0             0             0
47                      0             0             0             0
48                      0             0             0             0
49                      0             0             0             0
50                      0             0             0             0
51                      0             0             0             0
52                      0             0             0             0
53                      0             0             0             0
54                      0             0             0             0
55                      0             0             0             0
56                      0             0             0             0
57                      0             0             0             0
58                      0             0             0             0
59                      0             0             0             0
60                      0             0             0             0
61                      0             0             0             0
62                      0             0             0             0
63                      0             0             0             0
64                      0             0             0             0
65                      0             0             0             0
66                      0             0             0             0
67                      0             0             0             0
68                      0             0             0             0
69                      0             0             0             0
70                      0             0             0             0
71                      0           456             0             0
72                      0             0             0             0
73                      0             0             0             0
74                      0             0            28            86
75                      0             0            30            88
76                      0             0             0             0
77                      0             0            27            87
78                      0             0            28            88
79                      0             0             0             0
80                      0             0            28            84
81                      0             0             0             0
82                      0             0             0             0
83                      0             0             0             0
84                      0           412             0             0
85                      0             0             0             0
86                      0             0             0             0
87                      0             0             0             0
88                      0             0            29            87
89                      0             0            29            79
90                      0             0             0             0
91                      0             0             0             0
92                      0             0             0             0
93                      0             0             0             0
94                      0             0             0             0
95                      0             0             0             0
96                      0             0             0             0
97                      0             0             0             0
98                      0             0             0             0
99                      0             0             0             0
100                     0             0             0             0
101                     0             0             0             0
102                     0             0             0             0
103                     0             0             0             0
104                     0             0             0             0
105                     0             0             0             0
106                     0             0             0             0
107                     0             0             0             0
108                     0             0             0             0
109                     0             0             0             0
110                     0             0             0             0
111                     0             0             0             0
112                     0             0             0             0
113                     0             0             0             0
114                     0             0             0             0
115                     0             0             0             0
116                     0             0             0             0
117                     0             0             0             0
118                     0             0             0             0
119                     0           336             0             0
120                     0             0             0             0
121                     0             0             0             0
122                     0             0             0             0
123                     0             0            30            86
124                     0             0             0             0
125                     0             0            30            86
126                     0             0            30            88
127                     0             0             0             0
128                     0             0             0             0
129                     0             0             0             0
130                     0             0             0             0
131                     0             0             0             0
132                     0             0             0             0
133                     0             0             0             0
134                     0             0             0             0
135                     0             0             0             0
136                     0             0             0             0
137                     0             0             0             0
138                     0             0             0             0
139                     0             0             0             0
140                     0             0             0             0
141                     0             0             0             0
142                     0             0             0             0
143                     0             0             0             0
144                     0             0             0             0
145                     0             0             0             0
146                     0             0             0             0
147                     0             0             0             0
148                     0             0             0             0
149                     0             0             0             0
150                     0             0             0             0
151                     0             0             0             0
152                     0             0             0             0
153                     0             0             0             0
154                     0             0             0             0
155                     0             0             0             0
156                     0             0             0             0
157                     0             0             0             0
158                     0             0             0             0
159                     0             0             0             0
160                     0             0             0             0
161                     0             0             0             0
162                     0             0             0             0
163                     0             0             0             0
164                     0             0             0             0
165                     0             0             0             0
166                     0             0             0             0
167                     0             0             0             0
168                     0             0             0             0
    other_room_rental                  address postal postal_check
1                   0          1 TAMPINES WALK 528523         TRUE
2                   0            11 HOLLAND DR 278859         TRUE
3                   0      111 PLANTATION CRES 690111         TRUE
4                   0     111A PLANTATION CRES 691111         TRUE
5                   0     111B PLANTATION CRES 692111         TRUE
6                   0     111C PLANTATION CRES 693111         TRUE
7                   0      112 PLANTATION CRES 690112         TRUE
8                   0     112A PLANTATION CRES 691112         TRUE
9                   0     112B PLANTATION CRES 692112         TRUE
10                  0     113A PLANTATION CRES 691113         TRUE
11                  0     113B PLANTATION CRES 692113         TRUE
12                  0     114A PLANTATION CRES 691114         TRUE
13                  0     114B PLANTATION CRES 692114         TRUE
14                  0     116A PLANTATION CRES 691116         TRUE
15                  0     116B PLANTATION CRES 692116         TRUE
16                  0     117A PLANTATION CRES 691117         TRUE
17                  0     118A PLANTATION CRES 691118         TRUE
18                  0           123A TENGAH DR 691123         TRUE
19                  0           123B TENGAH DR 692123         TRUE
20                  0           123C TENGAH DR 693123         TRUE
21                  0           125A TENGAH DR 691125         TRUE
22                  0           125B TENGAH DR 692125         TRUE
23                  0           126A TENGAH DR 691126         TRUE
24                  0           126B TENGAH DR 692126         TRUE
25                  0           126C TENGAH DR 693126         TRUE
26                  0     127A PLANTATION CRES 691127         TRUE
27                  0     127B PLANTATION CRES 692127         TRUE
28                  0     128A PLANTATION CRES 691128         TRUE
29                  0     128B PLANTATION CRES 692128         TRUE
30                  0     129A PLANTATION CRES 691129         TRUE
31                  0     129B PLANTATION CRES 692129         TRUE
32                  0     129C PLANTATION CRES 693129         TRUE
33                  0      131A TENGAH GDN AVE 691131         TRUE
34                  0      131B TENGAH GDN AVE 692131         TRUE
35                  0      131C TENGAH GDN AVE 693131         TRUE
36                  0      131D TENGAH GDN AVE 694131         TRUE
37                  0       132 TENGAH GDN AVE 690132         TRUE
38                  0      132A TENGAH GDN AVE 691132         TRUE
39                  0      132B TENGAH GDN AVE 692132         TRUE
40                  0      132C TENGAH GDN AVE 693132         TRUE
41                  0       133 TENGAH GDN AVE 690133         TRUE
42                  0      133A TENGAH GDN AVE 691133         TRUE
43                  0      133B TENGAH GDN AVE 692133         TRUE
44                  0      133C TENGAH GDN AVE 693133         TRUE
45                  0 141A SERANGOON NTH AVE 2 554500         TRUE
46                  0              15 BEACH RD 189677         TRUE
47                  0     170 SENGKANG EAST DR 540170         TRUE
48                  0     171 SENGKANG EAST DR 540171         TRUE
49                  0    172C SENGKANG EAST DR 543172         TRUE
50                  0    172D SENGKANG EAST DR 544172         TRUE
51                  0     173 SENGKANG EAST DR 540173         TRUE
52                  0    173A SENGKANG EAST DR 541173         TRUE
53                  0    173B SENGKANG EAST DR 542173         TRUE
54                  0     175 SENGKANG EAST DR 540175         TRUE
55                  0         187 MARSILING RD 730187         TRUE
56                  0        187C MARSILING RD 733187         TRUE
57                  0         188 MARSILING RD 730188         TRUE
58                  0         189 MARSILING RD 730189         TRUE
59                  0             2 QUEEN'S RD 266733         TRUE
60                  0       208 WOODLEIGH LINK 360208         TRUE
61                  0         21 LOR 3 GEYLANG 380021         TRUE
62                  0         22 LOR 3 GEYLANG 380022         TRUE
63                  0          237 BOON LAY DR 640237         TRUE
64                  0         237A BOON LAY DR 641237         TRUE
65                  0         237B BOON LAY DR 642237         TRUE
66                  0         238A BOON LAY DR 641238         TRUE
67                  0         238B BOON LAY DR 642238         TRUE
68                  0         239A BOON LAY DR 641239         TRUE
69                  0         239B BOON LAY DR 642239         TRUE
70                  0         266 KIM KEAT AVE 310266         TRUE
71                  0           3 MARSILING RD 739230         TRUE
72                  0             3 QUEEN'S RD 266734         TRUE
73                  0               33 PK CRES 598814         TRUE
74                  3       34 TANGLIN HALT RD 142034         TRUE
75                  1       35 TANGLIN HALT RD 141035         TRUE
76                  0             358 UBI RD 3 400358         TRUE
77                  3       36 TANGLIN HALT RD 141036         TRUE
78                  2       37 TANGLIN HALT RD 140037         TRUE
79                  0             38 PINE LANE 390038         TRUE
80                  4       38 TANGLIN HALT RD 140038         TRUE
81                  0       381 YISHUN RING RD 760381         TRUE
82                  0         384 YISHUN AVE 6 760384         TRUE
83                  0              39 JLN TIGA 457778         TRUE
84                  0           4 MARSILING RD 739250         TRUE
85                  0       400D FERNVALE LANE 794400         TRUE
86                  0        401 FERNVALE LANE 790401         TRUE
87                  0       401C FERNVALE LANE 793401         TRUE
88                  2       42 TANGLIN HALT RD 141042         TRUE
89                  6       43 TANGLIN HALT RD 142043         TRUE
90                  0       431A NORTHSHORE DR 821431         TRUE
91                  0       431B NORTHSHORE DR 822431         TRUE
92                  0       431C NORTHSHORE DR 823431         TRUE
93                  0       432A NORTHSHORE DR 821432         TRUE
94                  0       432B NORTHSHORE DR 822432         TRUE
95                  0        433 NORTHSHORE DR 820433         TRUE
96                  0       433A NORTHSHORE DR 821433         TRUE
97                  0       433B NORTHSHORE DR 822433         TRUE
98                  0        435 NORTHSHORE DR 820435         TRUE
99                  0       437A NORTHSHORE DR 821437         TRUE
100                 0       437B NORTHSHORE DR 822437         TRUE
101                 0       438A NORTHSHORE DR 821438         TRUE
102                 0       438B NORTHSHORE DR 822438         TRUE
103                 0         446A PUNGGOL WAY 821446         TRUE
104                 0         446B PUNGGOL WAY 822446         TRUE
105                 0         448B PUNGGOL WAY 822448         TRUE
106                 0    459 SENGKANG WEST WAY 790459         TRUE
107                 0    461 SENGKANG WEST WAY 790461         TRUE
108                 0    463 SENGKANG WEST WAY 790463         TRUE
109                 0       464 CLEMENTI AVE 1 120464         TRUE
110                 0          464 FERNVALE RD 790464         TRUE
111                 0         464A FERNVALE RD 791464         TRUE
112                 0         464B FERNVALE RD 792464         TRUE
113                 0          465 FERNVALE RD 790465         TRUE
114                 0         465A FERNVALE RD 791465         TRUE
115                 0         465B FERNVALE RD 792465         TRUE
116                 0          466 FERNVALE RD 790466         TRUE
117                 0         466A FERNVALE RD 791466         TRUE
118                 0         466B FERNVALE RD 792466         TRUE
119                 0               5 BEACH RD 188094         TRUE
120                 0               5 JLN BATU 679530         TRUE
121                 0               52 KENT RD 118168         TRUE
122                 0               54 KENT RD 118169         TRUE
123                 2           56 C'WEALTH DR 141056         TRUE
124                 0               6 JLN BATU 588725         TRUE
125                 2           60 C'WEALTH DR 140060         TRUE
126                 1           62 C'WEALTH DR 140062         TRUE
127                 0       637 TAMPINES ST 62 520637         TRUE
128                 0       639 TAMPINES ST 62 520639         TRUE
129                 0       641 TAMPINES ST 62 520641         TRUE
130                 0       662 TAMPINES ST 64 520662         TRUE
131                 0      662A TAMPINES ST 64 521662         TRUE
132                 0      662B TAMPINES ST 64 522662         TRUE
133                 0      662C TAMPINES ST 64 523662         TRUE
134                 0      663A TAMPINES ST 64 521663         TRUE
135                 0      663B TAMPINES ST 64 522663         TRUE
136                 0      663C TAMPINES ST 64 523663         TRUE
137                 0           75A CIRCUIT RD 371075         TRUE
138                 0           75B CIRCUIT RD 372075         TRUE
139                 0            76 CIRCUIT RD 370076         TRUE
140                 0           76A CIRCUIT RD 371076         TRUE
141                 0      801 WEST COAST CRES 120801         TRUE
142                 0     801A WEST COAST CRES 121801         TRUE
143                 0     801B WEST COAST CRES 122801         TRUE
144                 0     801C WEST COAST CRES 123801         TRUE
145                 0       820 KEAT HONG LINK 680820         TRUE
146                 0       858C TAMPINES WALK 523858         TRUE
147                 0       858D TAMPINES WALK 524858         TRUE
148                 0       858E TAMPINES WALK 525858         TRUE
149                 0       859C TAMPINES WALK 523859         TRUE
150                 0       859D TAMPINES WALK 524859         TRUE
151                 0       860C TAMPINES WALK 523860         TRUE
152                 0       860D TAMPINES WALK 524860         TRUE
153                 0      890D TAMPINES AVE 1 524890         TRUE
154                 0      951A TAMPINES ST 96 521951         TRUE
155                 0      951B TAMPINES ST 96 522951         TRUE
156                 0      951C TAMPINES ST 96 523951         TRUE
157                 0       952 TAMPINES ST 96 520952         TRUE
158                 0      952A TAMPINES ST 96 521952         TRUE
159                 0      952B TAMPINES ST 96 522952         TRUE
160                 0      952C TAMPINES ST 96 523952         TRUE
161                 0      953A TAMPINES ST 96 521953         TRUE
162                 0      953B TAMPINES ST 96 522953         TRUE
163                 0      953C TAMPINES ST 96 523953         TRUE
164                 0       954 TAMPINES ST 96 520954         TRUE
165                 0      954A TAMPINES ST 96 521954         TRUE
166                 0      954B TAMPINES ST 96 522954         TRUE
167                 0      954C TAMPINES ST 96 523954         TRUE
168                 0      954D TAMPINES ST 96 524954         TRUE
hist((temp_hdb_property %>% filter(!(postal %in% extract_postal)))$year_completed)

(temp_hdb_property %>% filter(!(postal %in% extract_postal))) %>% group_by(year_completed) %>% summarise(total_count = n())
# A tibble: 12 × 2
   year_completed total_count
            <int>       <int>
 1           1962          10
 2           1963           2
 3           1968           1
 4           1973           4
 5           1974           3
 6           1981           2
 7           1995           1
 8           2003           1
 9           2014           1
10           2016           1
11           2023         100
12           2024          42

Look at combining OSM data for the newer data - 2023 and 2024 - missing from hdb dataset but present in property

Check if in OSM

missing_bldgs <- missing_bldgs %>% mutate(check = postal %in% osm_property_bldgs$postal)

missing_bldgs %>% select(c("address", "postal", "check"))
                     address postal check
1            1 TAMPINES WALK 528523 FALSE
2              11 HOLLAND DR 278859  TRUE
3        111 PLANTATION CRES 690111 FALSE
4       111A PLANTATION CRES 691111  TRUE
5       111B PLANTATION CRES 692111  TRUE
6       111C PLANTATION CRES 693111  TRUE
7        112 PLANTATION CRES 690112 FALSE
8       112A PLANTATION CRES 691112  TRUE
9       112B PLANTATION CRES 692112  TRUE
10      113A PLANTATION CRES 691113  TRUE
11      113B PLANTATION CRES 692113  TRUE
12      114A PLANTATION CRES 691114  TRUE
13      114B PLANTATION CRES 692114  TRUE
14      116A PLANTATION CRES 691116  TRUE
15      116B PLANTATION CRES 692116  TRUE
16      117A PLANTATION CRES 691117  TRUE
17      118A PLANTATION CRES 691118  TRUE
18            123A TENGAH DR 691123  TRUE
19            123B TENGAH DR 692123  TRUE
20            123C TENGAH DR 693123  TRUE
21            125A TENGAH DR 691125  TRUE
22            125B TENGAH DR 692125  TRUE
23            126A TENGAH DR 691126  TRUE
24            126B TENGAH DR 692126  TRUE
25            126C TENGAH DR 693126  TRUE
26      127A PLANTATION CRES 691127 FALSE
27      127B PLANTATION CRES 692127 FALSE
28      128A PLANTATION CRES 691128 FALSE
29      128B PLANTATION CRES 692128 FALSE
30      129A PLANTATION CRES 691129 FALSE
31      129B PLANTATION CRES 692129 FALSE
32      129C PLANTATION CRES 693129 FALSE
33       131A TENGAH GDN AVE 691131  TRUE
34       131B TENGAH GDN AVE 692131  TRUE
35       131C TENGAH GDN AVE 693131  TRUE
36       131D TENGAH GDN AVE 694131  TRUE
37        132 TENGAH GDN AVE 690132  TRUE
38       132A TENGAH GDN AVE 691132  TRUE
39       132B TENGAH GDN AVE 692132  TRUE
40       132C TENGAH GDN AVE 693132  TRUE
41        133 TENGAH GDN AVE 690133  TRUE
42       133A TENGAH GDN AVE 691133  TRUE
43       133B TENGAH GDN AVE 692133  TRUE
44       133C TENGAH GDN AVE 693133  TRUE
45  141A SERANGOON NTH AVE 2 554500 FALSE
46               15 BEACH RD 189677  TRUE
47      170 SENGKANG EAST DR 540170  TRUE
48      171 SENGKANG EAST DR 540171 FALSE
49     172C SENGKANG EAST DR 543172  TRUE
50     172D SENGKANG EAST DR 544172  TRUE
51      173 SENGKANG EAST DR 540173  TRUE
52     173A SENGKANG EAST DR 541173  TRUE
53     173B SENGKANG EAST DR 542173  TRUE
54      175 SENGKANG EAST DR 540175  TRUE
55          187 MARSILING RD 730187 FALSE
56         187C MARSILING RD 733187 FALSE
57          188 MARSILING RD 730188 FALSE
58          189 MARSILING RD 730189 FALSE
59              2 QUEEN'S RD 266733 FALSE
60        208 WOODLEIGH LINK 360208  TRUE
61          21 LOR 3 GEYLANG 380021  TRUE
62          22 LOR 3 GEYLANG 380022  TRUE
63           237 BOON LAY DR 640237 FALSE
64          237A BOON LAY DR 641237  TRUE
65          237B BOON LAY DR 642237  TRUE
66          238A BOON LAY DR 641238  TRUE
67          238B BOON LAY DR 642238  TRUE
68          239A BOON LAY DR 641239  TRUE
69          239B BOON LAY DR 642239  TRUE
70          266 KIM KEAT AVE 310266  TRUE
71            3 MARSILING RD 739230  TRUE
72              3 QUEEN'S RD 266734  TRUE
73                33 PK CRES 598814  TRUE
74        34 TANGLIN HALT RD 142034 FALSE
75        35 TANGLIN HALT RD 141035 FALSE
76              358 UBI RD 3 400358 FALSE
77        36 TANGLIN HALT RD 141036 FALSE
78        37 TANGLIN HALT RD 140037 FALSE
79              38 PINE LANE 390038 FALSE
80        38 TANGLIN HALT RD 140038  TRUE
81        381 YISHUN RING RD 760381 FALSE
82          384 YISHUN AVE 6 760384  TRUE
83               39 JLN TIGA 457778  TRUE
84            4 MARSILING RD 739250  TRUE
85        400D FERNVALE LANE 794400 FALSE
86         401 FERNVALE LANE 790401 FALSE
87        401C FERNVALE LANE 793401 FALSE
88        42 TANGLIN HALT RD 141042  TRUE
89        43 TANGLIN HALT RD 142043  TRUE
90        431A NORTHSHORE DR 821431 FALSE
91        431B NORTHSHORE DR 822431 FALSE
92        431C NORTHSHORE DR 823431 FALSE
93        432A NORTHSHORE DR 821432 FALSE
94        432B NORTHSHORE DR 822432 FALSE
95         433 NORTHSHORE DR 820433 FALSE
96        433A NORTHSHORE DR 821433 FALSE
97        433B NORTHSHORE DR 822433 FALSE
98         435 NORTHSHORE DR 820435  TRUE
99        437A NORTHSHORE DR 821437  TRUE
100       437B NORTHSHORE DR 822437  TRUE
101       438A NORTHSHORE DR 821438  TRUE
102       438B NORTHSHORE DR 822438  TRUE
103         446A PUNGGOL WAY 821446  TRUE
104         446B PUNGGOL WAY 822446  TRUE
105         448B PUNGGOL WAY 822448  TRUE
106    459 SENGKANG WEST WAY 790459 FALSE
107    461 SENGKANG WEST WAY 790461  TRUE
108    463 SENGKANG WEST WAY 790463  TRUE
109       464 CLEMENTI AVE 1 120464  TRUE
110          464 FERNVALE RD 790464 FALSE
111         464A FERNVALE RD 791464 FALSE
112         464B FERNVALE RD 792464 FALSE
113          465 FERNVALE RD 790465 FALSE
114         465A FERNVALE RD 791465 FALSE
115         465B FERNVALE RD 792465 FALSE
116          466 FERNVALE RD 790466 FALSE
117         466A FERNVALE RD 791466 FALSE
118         466B FERNVALE RD 792466 FALSE
119               5 BEACH RD 188094  TRUE
120               5 JLN BATU 679530  TRUE
121               52 KENT RD 118168  TRUE
122               54 KENT RD 118169  TRUE
123           56 C'WEALTH DR 141056  TRUE
124               6 JLN BATU 588725 FALSE
125           60 C'WEALTH DR 140060  TRUE
126           62 C'WEALTH DR 140062  TRUE
127       637 TAMPINES ST 62 520637 FALSE
128       639 TAMPINES ST 62 520639 FALSE
129       641 TAMPINES ST 62 520641 FALSE
130       662 TAMPINES ST 64 520662 FALSE
131      662A TAMPINES ST 64 521662  TRUE
132      662B TAMPINES ST 64 522662  TRUE
133      662C TAMPINES ST 64 523662  TRUE
134      663A TAMPINES ST 64 521663  TRUE
135      663B TAMPINES ST 64 522663  TRUE
136      663C TAMPINES ST 64 523663  TRUE
137           75A CIRCUIT RD 371075 FALSE
138           75B CIRCUIT RD 372075 FALSE
139            76 CIRCUIT RD 370076 FALSE
140           76A CIRCUIT RD 371076 FALSE
141      801 WEST COAST CRES 120801  TRUE
142     801A WEST COAST CRES 121801  TRUE
143     801B WEST COAST CRES 122801  TRUE
144     801C WEST COAST CRES 123801  TRUE
145       820 KEAT HONG LINK 680820 FALSE
146       858C TAMPINES WALK 523858  TRUE
147       858D TAMPINES WALK 524858  TRUE
148       858E TAMPINES WALK 525858 FALSE
149       859C TAMPINES WALK 523859  TRUE
150       859D TAMPINES WALK 524859  TRUE
151       860C TAMPINES WALK 523860  TRUE
152       860D TAMPINES WALK 524860  TRUE
153      890D TAMPINES AVE 1 524890 FALSE
154      951A TAMPINES ST 96 521951  TRUE
155      951B TAMPINES ST 96 522951  TRUE
156      951C TAMPINES ST 96 523951  TRUE
157       952 TAMPINES ST 96 520952 FALSE
158      952A TAMPINES ST 96 521952  TRUE
159      952B TAMPINES ST 96 522952  TRUE
160      952C TAMPINES ST 96 523952 FALSE
161      953A TAMPINES ST 96 521953  TRUE
162      953B TAMPINES ST 96 522953  TRUE
163      953C TAMPINES ST 96 523953  TRUE
164       954 TAMPINES ST 96 520954 FALSE
165      954A TAMPINES ST 96 521954  TRUE
166      954B TAMPINES ST 96 522954 FALSE
167      954C TAMPINES ST 96 523954  TRUE
168      954D TAMPINES ST 96 524954  TRUE

7 Matching with Land Use Data

7.1 Loading MP19 Dataset

raw_mp19 = st_read("data/fyp_preprocessing/MasterPlan2019LandUselayer.geojson")

attributes <- lapply(X = 1:nrow(raw_mp19), 
                     FUN = function(x) {

                       raw_mp19 %>% 
                         slice(x) %>%
                         pull(Description) %>%
                         read_html() %>%
                         html_node("table") %>%
                         html_table(header = TRUE, trim = TRUE, dec = ".", fill = TRUE) %>%
                         as_tibble(.name_repair = ~ make.names(c("Attribute", "Value"))) %>% 
                         pivot_wider(names_from = Attribute, values_from = Value)

                     })

mp19 <- 
  raw_mp19 %>%
  bind_cols(bind_rows(attributes)) %>%
  select(-Description)

mp19 <- mp19 %>% st_transform(crs = 3414)
mp19 <- st_zm(mp19)
write_rds(mp19, "data/fyp_preprocessing/mp19epsg3414.rds")
mp19 <- read_rds("data/fyp_preprocessing/mp19epsg3414.rds")
mp19
Simple feature collection with 113212 features and 8 fields
Geometry type: MULTIPOLYGON
Dimension:     XY
Bounding box:  xmin: 2667.538 ymin: 15748.72 xmax: 91863.62 ymax: 50256.33
Projected CRS: SVY21 / Singapore TM
First 10 features:
     Name          LU_DESC LU_TEXT  GPR WHI_Q_MX GPR_B_MN          INC_CRC
1   kml_1       OPEN SPACE          EVA                   2481817E4931D054
2   kml_2             ROAD         <NA>                   C56C3E0EA19D36D8
3   kml_3 PLACE OF WORSHIP       W  EVA                   4EB80310CE2C1B60
4   kml_4             ROAD         <NA>                   544B09AB3A799753
5   kml_5       COMMERCIAL          EVA                   BB3AF1EBDFBB5AD9
6   kml_6       BUSINESS 2          1.0                   344ED7728B4D6940
7   kml_7       BUSINESS 2          2.5                   5BCB57488D4CFABD
8   kml_8       BUSINESS 2          1.4                   EF5D3B3B047F4CCF
9   kml_9       BUSINESS 2          1.4                   2248F66B8739A80B
10 kml_10       BUSINESS 2          1.4                   B8032F4B1E617273
       FMEL_UPD_D                       geometry
1  20191209171707 MULTIPOLYGON (((26136.73 35...
2  20191209171707 MULTIPOLYGON (((28224.06 35...
3  20191209171707 MULTIPOLYGON (((17055.39 39...
4  20191209171707 MULTIPOLYGON (((31712.04 43...
5  20191209171707 MULTIPOLYGON (((31920.59 43...
6  20191209171707 MULTIPOLYGON (((31560.7 431...
7  20191209171707 MULTIPOLYGON (((6573.416 34...
8  20191209171707 MULTIPOLYGON (((6539.517 34...
9  20191209171707 MULTIPOLYGON (((6316.274 35...
10 20191209171707 MULTIPOLYGON (((6288.463 35...
mp19_resi <- mp19 %>% filter(LU_DESC == "RESIDENTIAL")
centr <- st_centroid(datagov_hdb_property_bldgs)
centr
Simple feature collection with 12854 features and 33 fields
Geometry type: POINT
Dimension:     XY
Bounding box:  xmin: 11519.15 ymin: 28097.64 xmax: 45292.59 ymax: 48738.63
Projected CRS: SVY21 / Singapore TM
First 10 features:
     Name BLK_NO ST_COD ENTITYID POSTAL_COD          INC_CRC     FMEL_UPD_D
1   kml_1   780C WOC05L     1991     733780 B93627FDFF3D6313 20230328181025
2   kml_2    373 BUS09S     6782     650373 49487496978A23EF 20130426120311
3   kml_3    328 TAS39U     7578     520328 67E2089D8D4D20D0 20130426120323
4   kml_4   771A CHS27B      307     681771 577EE045DEA00FEE 20130426120328
5   kml_5     3A TEC01D     7332     091003 AF8FF795FF2C87EA 20130426120321
6   kml_6   781C WOA05F    12799     733781 9257EC517D945A34 20230328181025
7   kml_7    465 CRL00Q     6128     190465 FA7E0AEE86FFEA6A 20230328181025
8   kml_8      2 STG00S     7153     322002 A0BBA1BEA0B7120C 20230328181025
9   kml_9    778 WOD14U     9072     730778 9B399758F26B6046 20130426120335
10 kml_10    862 WOS07U    12726     730862 3E0F54CD91F1FF15 20130426120332
   blk_no              street max_floor_lvl year_completed residential
1    780C      WOODLANDS CRES            16           2013           Y
2     373      BT BATOK ST 31             3           1986           N
3     328      TAMPINES ST 32            10           1993           Y
4    771A CHOA CHU KANG ST 54             5           1995           N
5      3A  TELOK BLANGAH CRES             3           2004           N
6    781C     WOODLANDS AVE 9            16           2022           Y
7     465       CRAWFORD LANE             2           1982           N
8       2     ST. GEORGE'S RD            14           1975           Y
9     778     WOODLANDS DR 60            14           1996           Y
10    862     WOODLANDS ST 83            11           1994           Y
   commercial market_hawker miscellaneous multistorey_carpark precinct_pavilion
1           N             N             N                   N                 N
2           Y             N             N                   N                 N
3           Y             N             N                   N                 N
4           N             N             N                   Y                 N
5           N             N             N                   Y                 N
6           N             N             N                   N                 N
7           Y             N             N                   N                 N
8           N             N             Y                   N                 N
9           N             N             N                   N                 N
10          N             N             Y                   N                 N
   bldg_contract_town total_dwelling_units X1room_sold X2room_sold X3room_sold
1                  WL                  135           0           0          30
2                  BB                    0           0           0           0
3                 TAP                   54           0           0           0
4                 CCK                    0           0           0           0
5                  BM                    0           0           0           0
6                  WL                  209           0         105          45
7                 KWN                    0           0           0           0
8                 KWN                  154           0           0         152
9                  WL                  111           0           0           0
10                 WL                   60           0           0           0
   X4room_sold X5room_sold exec_sold multigen_sold studio_apartment_sold
1          105           0         0             0                     0
2            0           0         0             0                     0
3            0           0        54             0                     0
4            0           0         0             0                     0
5            0           0         0             0                     0
6           59           0         0             0                     0
7            0           0         0             0                     0
8            0           2         0             0                     0
9           61          50         0             0                     0
10           0          60         0             0                     0
   X1room_rental X2room_rental X3room_rental other_room_rental
1              0             0             0                 0
2              0             0             0                 0
3              0             0             0                 0
4              0             0             0                 0
5              0             0             0                 0
6              0             0             0                 0
7              0             0             0                 0
8              0             0             0                 0
9              0             0             0                 0
10             0             0             0                 0
                    address postal_check                  geometry
1       780C WOODLANDS CRES         TRUE  POINT (24458.3 47864.69)
2        373 BT BATOK ST 31         TRUE POINT (18771.81 37888.65)
3        328 TAMPINES ST 32         TRUE POINT (41907.43 37272.88)
4  771A CHOA CHU KANG ST 54         TRUE POINT (18723.77 41826.05)
5     3A TELOK BLANGAH CRES         TRUE POINT (26246.54 29052.02)
6      781C WOODLANDS AVE 9         TRUE  POINT (24561.8 47839.54)
7         465 CRAWFORD LANE         TRUE POINT (31274.88 31941.64)
8         2 ST. GEORGE'S RD         TRUE POINT (31045.58 33963.12)
9       778 WOODLANDS DR 60         TRUE POINT (24250.93 47670.21)
10      862 WOODLANDS ST 83         TRUE POINT (23747.73 46856.38)
datagov_hdb_property_bldgs_proc <- st_intersection(datagov_hdb_property_bldgs, mp19_resi)
datagov_hdb_property_bldgs_proc
Simple feature collection with 12245 features and 41 fields
Geometry type: GEOMETRY
Dimension:     XY
Bounding box:  xmin: 11467.71 ymin: 28056.22 xmax: 42690.47 ymax: 48760.3
Projected CRS: SVY21 / Singapore TM
First 10 features:
           Name BLK_NO ST_COD ENTITYID POSTAL_COD          INC_CRC
296     kml_296    358 YUA01W     7923     610358 1DA3319CE95B9EAA
991     kml_991    362 YUA01W     4763     610362 402DDE98AE8446E1
2192   kml_2189    359 YUA01W     2493     610359 D5431A5190A5A7C3
2608   kml_2604    360 YUA01W     3543     610360 C6A3D5997AF2E121
4025   kml_4021    361 YUA01W     8564     610361 664439D7A8DCECF7
5329   kml_5323    369 YUA01W     5315     610369 DB9F10056EF2A6B2
6888   kml_6882    357 YUA01W     5609     610357 EAE4A26A3B09A3AE
6934   kml_6928    363 YUA01W     4985     610363 6BFE50399FBD3A21
11072 kml_11066    367 COD04N     2646     610367 73004673D47CC95D
11295 kml_11288    368 COD04N     2798     610368 E950D11DA5671555
          FMEL_UPD_D blk_no         street max_floor_lvl year_completed
296   20130426120326    358     YUNG AN RD            15           1994
991   20130426120247    362     YUNG AN RD            10           1994
2192  20130426120222    359     YUNG AN RD            15           1994
2608  20130426120236    360     YUNG AN RD            12           1994
4025  20130426120334    361     YUNG AN RD            12           1994
5329  20130426120254    369     YUNG AN RD            10           1993
6888  20130426120258    357     YUNG AN RD            15           1994
6934  20130426120254    363     YUNG AN RD            10           1994
11072 20130426120227    367 CORPORATION DR            10           1996
11295 20130426120224    368 CORPORATION DR            10           1996
      residential commercial market_hawker miscellaneous multistorey_carpark
296             Y          N             N             N                   N
991             Y          Y             N             N                   N
2192            Y          N             N             Y                   N
2608            Y          N             N             N                   N
4025            Y          N             N             Y                   N
5329            Y          N             N             N                   N
6888            Y          N             N             N                   N
6934            Y          N             N             N                   N
11072           Y          N             N             N                   N
11295           Y          Y             N             N                   N
      precinct_pavilion bldg_contract_town total_dwelling_units X1room_sold
296                   N                 JW                   56           0
991                   N                 JW                   36           0
2192                  N                 JW                  126           0
2608                  N                 JW                   92           0
4025                  N                 JW                  114           0
5329                  N                 JW                   45           0
6888                  N                 JW                   86           0
6934                  N                 JW                   36           0
11072                 N                 JW                   81           0
11295                 N                 JW                   90           0
      X2room_sold X3room_sold X4room_sold X5room_sold exec_sold multigen_sold
296             0           0           0          56         0             0
991             0           0           0           0        36             0
2192            0           0          84          42         0             0
2608            0           0          70          22         0             0
4025            0           0          92          22         0             0
5329            0           0           0           0        45             0
6888            0           0          44          42         0             0
6934            0           0           0           0        36             0
11072           0           0          45          36         0             0
11295           0           0          54          36         0             0
      studio_apartment_sold X1room_rental X2room_rental X3room_rental
296                       0             0             0             0
991                       0             0             0             0
2192                      0             0             0             0
2608                      0             0             0             0
4025                      0             0             0             0
5329                      0             0             0             0
6888                      0             0             0             0
6934                      0             0             0             0
11072                     0             0             0             0
11295                     0             0             0             0
      other_room_rental            address postal_check   Name.1     LU_DESC
296                   0     358 YUNG AN RD         TRUE kml_1319 RESIDENTIAL
991                   0     362 YUNG AN RD         TRUE kml_1319 RESIDENTIAL
2192                  0     359 YUNG AN RD         TRUE kml_1319 RESIDENTIAL
2608                  0     360 YUNG AN RD         TRUE kml_1319 RESIDENTIAL
4025                  0     361 YUNG AN RD         TRUE kml_1319 RESIDENTIAL
5329                  0     369 YUNG AN RD         TRUE kml_1319 RESIDENTIAL
6888                  0     357 YUNG AN RD         TRUE kml_1319 RESIDENTIAL
6934                  0     363 YUNG AN RD         TRUE kml_1319 RESIDENTIAL
11072                 0 367 CORPORATION DR         TRUE kml_1319 RESIDENTIAL
11295                 0 368 CORPORATION DR         TRUE kml_1319 RESIDENTIAL
      LU_TEXT GPR WHI_Q_MX GPR_B_MN        INC_CRC.1   FMEL_UPD_D.1
296           2.8                   C07C7D1E8897E480 20191209171707
991           2.8                   C07C7D1E8897E480 20191209171707
2192          2.8                   C07C7D1E8897E480 20191209171707
2608          2.8                   C07C7D1E8897E480 20191209171707
4025          2.8                   C07C7D1E8897E480 20191209171707
5329          2.8                   C07C7D1E8897E480 20191209171707
6888          2.8                   C07C7D1E8897E480 20191209171707
6934          2.8                   C07C7D1E8897E480 20191209171707
11072         2.8                   C07C7D1E8897E480 20191209171707
11295         2.8                   C07C7D1E8897E480 20191209171707
                            geometry
296   POLYGON ((15449.64 35400.5,...
991   POLYGON ((15389.96 35394.93...
2192  POLYGON ((15540.1 35385.88,...
2608  POLYGON ((15474.56 35365.71...
4025  POLYGON ((15409.06 35345.44...
5329  POLYGON ((15364.53 35482.72...
6888  POLYGON ((15501.56 35450.46...
6934  POLYGON ((15383.46 35405.14...
11072 POLYGON ((15319.35 35590.64...
11295 POLYGON ((15315.5 35535.95,...
temp_export <- select(datagov_hdb_property_bldgs_proc, c("Name", "ST_COD", "POSTAL_COD", "blk_no", "street", "max_floor_lvl", "year_completed", "bldg_contract_town", "address", "Name.1", "LU_DESC", "GPR"))
temp_export <- st_collection_extract(temp_export, "POLYGON")
st_write(temp_export, dsn = "data/fyp_preprocessing/hdb_buildings/hdb_buildings20240820.shp")
st_write(mp19_resi, dsn = "data/fyp_preprocessing/mp19/mp19resi20240820.shp")